aboutsummaryrefslogtreecommitdiff
path: root/src/or/main.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-03-12 00:19:52 -0500
committerNick Mathewson <nickm@torproject.org>2011-03-12 00:19:52 -0500
commit176fde505fde38afa56ddce04606118b9080546e (patch)
tree1579c6a4a6714f41cfcba0911808b7da2c53f666 /src/or/main.c
parent977e396e866052a20de73f4e8121e514d4eff774 (diff)
downloadtor-176fde505fde38afa56ddce04606118b9080546e.tar.gz
tor-176fde505fde38afa56ddce04606118b9080546e.zip
Tweak bug2716 patch a little
Name the magic value "10" rather than re-deriving it. Comment more. Use the pattern that works for periodic timers, not the pattern that doesn't work. ;)
Diffstat (limited to 'src/or/main.c')
-rw-r--r--src/or/main.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/or/main.c b/src/or/main.c
index 558608ec8c..214a4fad5d 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -872,6 +872,7 @@ run_scheduled_events(time_t now)
static time_t time_to_check_for_expired_networkstatus = 0;
static time_t time_to_write_stats_files = 0;
static time_t time_to_write_bridge_stats = 0;
+ static time_t time_to_launch_reachability_tests = 0;
static int should_init_bridge_stats = 1;
static time_t time_to_retry_dns_init = 0;
or_options_t *options = get_options();
@@ -962,9 +963,10 @@ run_scheduled_events(time_t now)
if (accounting_is_enabled(options))
accounting_run_housekeeping(now);
- if (now % REACHABILITY_TEST_PERIOD/REACHABILITY_MODULO_PER_TEST == 0 &&
+ if (time_to_launch_reachability_tests < now &&
(authdir_mode_tests_reachability(options)) &&
!we_are_hibernating()) {
+ time_to_launch_reachability_tests = now + REACHABILITY_TEST_INTERVAL;
/* try to determine reachability of the other Tor relays */
dirserv_test_reachability(now);
}