-
- Downloads
Refactor storing of measured_bw versus Unmeasured=1.
This patch moves the measured_bw field and the has_measured_bw field into vote_routerstatus_t, since only votes have 'Measured=XX' set on their weight line. I also added a new bw_is_unmeasured flag to routerstatus_t to represent the Unmeasured=1 flag on a w line. Previously, I was using has_measured_bw for this, which was quite incorrect: has_measured_bw means that the measured_bw field is set, and it's probably a mistake to have it serve double duty as meaning that 'baandwidth' represents a measured value. While making this change,I also found a harmless but stupid bug in dirserv_read_measured_bandwidths: It assumes that it's getting a smartlist of routerstatus_t, when really it's getting a smartlist of vote_routerstatus_t. C's struct layout rules mean that we could never actually get an error because of that, but it's still quite incorrect. I fixed that, and in the process needed to add two more sorting and searching helpers. Finally, I made the Unmeasured=1 flag get parsed. We don't use it for anything yet, but someday we might. This isn't complete yet -- the new 2286 unit test doesn't build.
Showing
- src/or/dirserv.c 12 additions, 9 deletionssrc/or/dirserv.c
- src/or/dirserv.h 2 additions, 1 deletionsrc/or/dirserv.h
- src/or/dirvote.c 7 additions, 6 deletionssrc/or/dirvote.c
- src/or/networkstatus.c 12 additions, 1 deletionsrc/or/networkstatus.c
- src/or/networkstatus.h 2 additions, 0 deletionssrc/or/networkstatus.h
- src/or/or.h 4 additions, 3 deletionssrc/or/or.h
- src/or/routerparse.c 13 additions, 3 deletionssrc/or/routerparse.c
- src/or/routerparse.h 1 addition, 0 deletionssrc/or/routerparse.h
Loading
Please register or sign in to comment