aboutsummaryrefslogtreecommitdiff
path: root/src/feature/dirauth/bwauth.c
diff options
context:
space:
mode:
authorteor <teor@torproject.org>2019-03-21 12:04:30 +1000
committerteor <teor@torproject.org>2019-03-21 12:04:30 +1000
commit3adb689fbc28434efa6a3b599163b1d5b6cae3e9 (patch)
tree77ca7728a3b96ce110b2057cd71fda5dd74e1c06 /src/feature/dirauth/bwauth.c
parent41cd05562f68c23f8c3d95472e20a86165f6dc20 (diff)
parent4ab2e9a5990bd6f1fd65f2600dc7487686c801ff (diff)
downloadtor-3adb689fbc28434efa6a3b599163b1d5b6cae3e9.tar.gz
tor-3adb689fbc28434efa6a3b599163b1d5b6cae3e9.zip
Merge branch 'ticket29806_034_squashed' into ticket29806_035_squashed_merged
Copy and paste the vote=0 code from the old src/or/dirserv.c to the new src/feature/dirauth/bwauth.c.
Diffstat (limited to 'src/feature/dirauth/bwauth.c')
-rw-r--r--src/feature/dirauth/bwauth.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/feature/dirauth/bwauth.c b/src/feature/dirauth/bwauth.c
index a31050ff9c..12f9399e9f 100644
--- a/src/feature/dirauth/bwauth.c
+++ b/src/feature/dirauth/bwauth.c
@@ -366,7 +366,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) {