diff options
author | Nick Mathewson <nickm@torproject.org> | 2020-08-04 12:59:49 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2020-08-04 13:05:07 -0400 |
commit | 62361cc6988bba1420f89fe8273b4caf3c96b704 (patch) | |
tree | 3a46b9ed5bbff84c1c070dacb7662534bc981719 /src | |
parent | c4742b89b23d58958ee0d5ca324dac5948c94bf6 (diff) | |
download | tor-62361cc6988bba1420f89fe8273b4caf3c96b704.tar.gz tor-62361cc6988bba1420f89fe8273b4caf3c96b704.zip |
Launch early reachability tests once a minute, not once a second.
This fixes bug 40083, which was introduced in 9f31908a in
0.2.8.1-alpha.
Diffstat (limited to 'src')
-rw-r--r-- | src/core/mainloop/mainloop.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/mainloop/mainloop.c b/src/core/mainloop/mainloop.c index f0aa37e8da..0e2ea7b769 100644 --- a/src/core/mainloop/mainloop.c +++ b/src/core/mainloop/mainloop.c @@ -2280,6 +2280,9 @@ check_for_reachability_bw_callback(time_t now, const or_options_t *options) { /* XXXX This whole thing was stuck in the middle of what is now * XXXX check_descriptor_callback. I'm not sure it's right. */ + /** How often should we consider launching reachability tests in our first + * TIMEOUT_UNTIL_UNREACHABILITY_COMPLAINT seconds? */ +#define EARLY_CHECK_REACHABILITY_INTERVAL (60) static int dirport_reachability_count = 0; /* also, check religiously for reachability, if it's within the first @@ -2291,7 +2294,7 @@ check_for_reachability_bw_callback(time_t now, const or_options_t *options) router_do_reachability_checks(1, dirport_reachability_count==0); if (++dirport_reachability_count > 5) dirport_reachability_count = 0; - return 1; + return EARLY_CHECK_REACHABILITY_INTERVAL; } else { /* If we haven't checked for 12 hours and our bandwidth estimate is * low, do another bandwidth test. This is especially important for |