Browse Source

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.


svn:r10156

Roger Dingledine 18 years ago
parent
commit
4e9a008e66
1 changed files with 6 additions and 2 deletions
  1. 6 2
      src/or/routerlist.c

+ 6 - 2
src/or/routerlist.c

@@ -3188,8 +3188,12 @@ update_networkstatus_client_downloads(time_t now)
       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;
       }