aboutsummaryrefslogtreecommitdiff
path: root/src/or/dirserv.c
diff options
context:
space:
mode:
authorjuga0 <juga@riseup.net>2019-03-19 11:48:42 +0000
committerteor <teor@torproject.org>2019-03-21 12:00:45 +1000
commit4ab2e9a5990bd6f1fd65f2600dc7487686c801ff (patch)
tree8621e53bd242b0ed08979079d9f0954a9491e243 /src/or/dirserv.c
parente021f89f3636d197058dddea4383632bdf466ff0 (diff)
downloadtor-4ab2e9a5990bd6f1fd65f2600dc7487686c801ff.tar.gz
tor-4ab2e9a5990bd6f1fd65f2600dc7487686c801ff.zip
bwauth: Ignore bandwidth file lines with "vote=0"
so that the relays that would be "excluded" from the bandwidth file because of something failed can be included to diagnose what failed, without still including these relays in the bandwidth authorities vote. Closes #29806.
Diffstat (limited to 'src/or/dirserv.c')
-rw-r--r--src/or/dirserv.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index 4e09c1c65b..ae1975f166 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -2497,7 +2497,13 @@ measured_bw_line_parse(measured_bw_line_t *out, const char *orig_line,
}
do {
- if (strcmpstart(cp, "bw=") == 0) {
+ // If the line contains vote=0, ignore it.
+ if (strcmpstart(cp, "vote=0") == 0) {
+ log_debug(LD_DIRSERV, "Ignoring bandwidth file line that contains "
+ "vote=0: %s",escaped(orig_line));
+ tor_free(line);
+ return -1;
+ } else if (strcmpstart(cp, "bw=") == 0) {
int parse_ok = 0;
char *endptr;
if (got_bw) {