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

[or-cvs] r10156: Backport candidate: if all of our dirservers have given us b (tor/trunk/src/or)



Author: arma
Date: 2007-05-10 05:34:34 -0400 (Thu, 10 May 2007)
New Revision: 10156

Modified:
   tor/trunk/src/or/routerlist.c
Log:
Backport candidate: if all of our dirservers have given us
bad or no networkstatuses lately, then stop hammering them
once per minute even if we think they're failed.


Modified: tor/trunk/src/or/routerlist.c
===================================================================
--- tor/trunk/src/or/routerlist.c	2007-05-10 08:57:57 UTC (rev 10155)
+++ tor/trunk/src/or/routerlist.c	2007-05-10 09:34:34 UTC (rev 10156)
@@ -3188,8 +3188,12 @@
       ds = smartlist_get(trusted_dir_servers, i);
       if (!(ds->type & V2_AUTHORITY))
         continue;
-      if (n_failed < n_dirservers &&
-          ds->n_networkstatus_failures > NETWORKSTATUS_N_ALLOWABLE_FAILURES) {
+      if (n_failed >= n_dirservers) {
+        log_info(LD_DIR, "All authorities have failed. Not trying any.");
+        smartlist_free(missing);
+        return;
+      }
+      if (ds->n_networkstatus_failures > NETWORKSTATUS_N_ALLOWABLE_FAILURES) {
         ++n_failed;
         continue;
       }