aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2006-10-08 06:33:02 +0000
committerRoger Dingledine <arma@torproject.org>2006-10-08 06:33:02 +0000
commit538c54e376caf918e3777afeba5381c6e67cee1d (patch)
tree208aca789dfed3094e39b7493daa8785654ae610 /src
parentceb3a50977bb19bd43b1913797364bf6f57ac204 (diff)
downloadtor-538c54e376caf918e3777afeba5381c6e67cee1d.tar
tor-538c54e376caf918e3777afeba5381c6e67cee1d.tar.gz
try dirport reachability testing five times less often.
it's already so darn thorough per test -- it chews through like four circuits before giving up. svn:r8646
Diffstat (limited to 'src')
-rw-r--r--src/or/dirserv.c2
-rw-r--r--src/or/main.c8
2 files changed, 6 insertions, 4 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index 872f2f065..4a5b1f7e0 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -21,8 +21,6 @@ const char dirserv_c_id[] =
* directory authorities. */
#define MAX_UNTRUSTED_NETWORKSTATUSES 16
-extern long stats_n_seconds_working;
-
typedef enum {
FP_NAMED, /**< Listed in fingerprint file. */
FP_VALID, /**< Unlisted but believed valid. */
diff --git a/src/or/main.c b/src/or/main.c
index e6eda1665..19e3d7fb2 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -833,6 +833,7 @@ run_scheduled_events(time_t now)
/* 2b. Once per minute, regenerate and upload the descriptor if the old
* one is inaccurate. */
if (time_to_check_descriptor < 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) {
@@ -847,8 +848,11 @@ run_scheduled_events(time_t now)
if (server_mode(options) &&
(has_completed_circuit || !any_predicted_circuits(now)) &&
stats_n_seconds_working < TIMEOUT_UNTIL_UNREACHABILITY_COMPLAINT &&
- !we_are_hibernating())
- consider_testing_reachability(1, 1);
+ !we_are_hibernating()) {
+ consider_testing_reachability(1, dirport_reachability_count==0);
+ if (++dirport_reachability_count > 5)
+ dirport_reachability_count = 0;
+ }
/* If any networkstatus documents are no longer recent, we need to
* update all the descriptors' running status. */