[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r8646: try dirport reachability testing five times less often. it's (tor/trunk/src/or)



Author: arma
Date: 2006-10-08 02:33:02 -0400 (Sun, 08 Oct 2006)
New Revision: 8646

Modified:
   tor/trunk/src/or/dirserv.c
   tor/trunk/src/or/main.c
Log:
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.


Modified: tor/trunk/src/or/dirserv.c
===================================================================
--- tor/trunk/src/or/dirserv.c	2006-10-08 03:17:24 UTC (rev 8645)
+++ tor/trunk/src/or/dirserv.c	2006-10-08 06:33:02 UTC (rev 8646)
@@ -21,8 +21,6 @@
  * 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. */

Modified: tor/trunk/src/or/main.c
===================================================================
--- tor/trunk/src/or/main.c	2006-10-08 03:17:24 UTC (rev 8645)
+++ tor/trunk/src/or/main.c	2006-10-08 06:33:02 UTC (rev 8646)
@@ -833,6 +833,7 @@
   /* 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 @@
     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. */