diff options
author | Roger Dingledine <arma@torproject.org> | 2013-02-11 22:07:19 -0500 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2013-02-11 22:07:19 -0500 |
commit | b166e9edb96288e8f94776b738c1dc0874a9cffa (patch) | |
tree | 541a9b43dd676873b6141ef9d97f274f4403b072 /src | |
parent | 5911fc0c17176bbff379921b7905ec990f505f85 (diff) | |
download | tor-b166e9edb96288e8f94776b738c1dc0874a9cffa.tar tor-b166e9edb96288e8f94776b738c1dc0874a9cffa.tar.gz |
simplify timing checks
now that both timers are on the same schedule, there's no point
tracking separate timers.
Diffstat (limited to 'src')
-rw-r--r-- | src/or/main.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/or/main.c b/src/or/main.c index 98d3359cf..b5d1e2da3 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -1157,7 +1157,6 @@ run_scheduled_events(time_t now) static time_t time_to_check_v3_certificate = 0; static time_t time_to_check_listeners = 0; static time_t time_to_check_descriptor = 0; - static time_t time_to_check_ipaddress = 0; static time_t time_to_shrink_memory = 0; static time_t time_to_try_getting_descriptors = 0; static time_t time_to_reset_descriptor_failures = 0; @@ -1403,11 +1402,10 @@ run_scheduled_events(time_t now) /** 2. Periodically, we consider force-uploading our descriptor * (if we've passed our internal checks). */ -/** How often do we check whether part of our router info has changed in a way - * that would require an upload? */ +/** How often do we check whether part of our router info has changed in a + * way that would require an upload? That includes checking whether our IP + * address has changed. */ #define CHECK_DESCRIPTOR_INTERVAL (60) -/** How often do we (as a router) check whether our IP address has changed? */ -#define CHECK_IPADDRESS_INTERVAL (60) /* 2b. Once per minute, regenerate and upload the descriptor if the old * one is inaccurate. */ @@ -1415,10 +1413,7 @@ run_scheduled_events(time_t now) static int dirport_reachability_count = 0; time_to_check_descriptor = now + CHECK_DESCRIPTOR_INTERVAL; check_descriptor_bandwidth_changed(now); - if (time_to_check_ipaddress < now) { - time_to_check_ipaddress = now + CHECK_IPADDRESS_INTERVAL; - check_descriptor_ipaddress_changed(now); - } + check_descriptor_ipaddress_changed(now); mark_my_descriptor_dirty_if_too_old(now); consider_publishable_server(0); /* also, check religiously for reachability, if it's within the first |