[or-cvs] r12136: Authorities no longer send back "400 you're unreachable plea (in tor/trunk: . src/or)

arma at seul.org arma at seul.org
Wed Oct 24 03:34:04 UTC 2007


Author: arma
Date: 2007-10-23 23:34:03 -0400 (Tue, 23 Oct 2007)
New Revision: 12136

Modified:
   tor/trunk/ChangeLog
   tor/trunk/src/or/dirserv.c
   tor/trunk/src/or/or.h
   tor/trunk/src/or/routerlist.c
Log:
Authorities no longer send back "400 you're unreachable please fix
it" errors to Tor servers that aren't online all the time. We're
supposed to tolerate these servers now.


Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2007-10-24 03:31:12 UTC (rev 12135)
+++ tor/trunk/ChangeLog	2007-10-24 03:34:03 UTC (rev 12136)
@@ -79,6 +79,9 @@
       on our configured V3AuthVotingInterval: so unless the intervals
       matched up, we immediately rejected our own vote because it didn't
       start at the voting interval that caused us to construct a vote.
+    - Authorities no longer send back "400 you're unreachable please fix
+      it" errors to Tor servers that aren't online all the time. We're
+      supposed to tolerate these servers now.
 
   o Minor bugfixes (v3 directory protocol):
     - Delete unverified-consensus when the real consensus is set.

Modified: tor/trunk/src/or/dirserv.c
===================================================================
--- tor/trunk/src/or/dirserv.c	2007-10-24 03:31:12 UTC (rev 12135)
+++ tor/trunk/src/or/dirserv.c	2007-10-24 03:34:03 UTC (rev 12136)
@@ -883,22 +883,6 @@
   router->is_running = answer;
 }
 
-/** Return 1 if we're confident that there's a problem with
- * <b>router</b>'s reachability and its operator should be notified.
- */
-int
-dirserv_thinks_router_is_blatantly_unreachable(routerinfo_t *router,
-                                               time_t now)
-{
-  if (router->is_hibernating)
-    return 0;
-  if (now >= router->last_reachable + 5*REACHABLE_TIMEOUT &&
-      router->testing_since &&
-      now >= router->testing_since + 5*REACHABLE_TIMEOUT)
-    return 1;
-  return 0;
-}
-
 /** Based on the routerinfo_ts in <b>routers</b>, allocate the
  * contents of a v1-style router-status line, and store it in
  * *<b>router_status_out</b>.  Return 0 on success, -1 on failure.
@@ -2452,7 +2436,6 @@
                ri->nickname);
       rep_hist_note_router_reachable(digest_rcvd, now);
       ri->last_reachable = now;
-      ri->num_unreachable_notifications = 0;
     }
   });
   /* FFFF Maybe we should reinstate the code that dumps routers with the same

Modified: tor/trunk/src/or/or.h
===================================================================
--- tor/trunk/src/or/or.h	2007-10-24 03:31:12 UTC (rev 12135)
+++ tor/trunk/src/or/or.h	2007-10-24 03:34:03 UTC (rev 12136)
@@ -1181,9 +1181,6 @@
   time_t last_reachable;
   /** When did we start testing reachability for this OR? */
   time_t testing_since;
-  /** How many times has a descriptor been posted and we believed
-   * this router to be unreachable? We only actually warn on the third. */
-  int num_unreachable_notifications;
 
   /** What position is this descriptor within routerlist->routers? -1 for
    * none. */
@@ -2853,8 +2850,6 @@
 int getinfo_helper_dirserv_unregistered(control_connection_t *conn,
                                         const char *question, char **answer);
 void dirserv_free_descriptors(void);
-int dirserv_thinks_router_is_blatantly_unreachable(routerinfo_t *router,
-                                                   time_t now);
 int list_server_status(smartlist_t *routers, char **router_status_out,
                        int for_controller);
 int dirserv_dump_directory_to_string(char **dir_out,

Modified: tor/trunk/src/or/routerlist.c
===================================================================
--- tor/trunk/src/or/routerlist.c	2007-10-24 03:31:12 UTC (rev 12135)
+++ tor/trunk/src/or/routerlist.c	2007-10-24 03:34:03 UTC (rev 12136)
@@ -2536,11 +2536,6 @@
   int authdir = authdir_mode(get_options());
   int authdir_believes_valid = 0;
   routerinfo_t *old_router;
-  /* router_have_minimum_dir_info() has side effects, so do it before we
-   * start the real work */
-  int authdir_may_warn_about_unreachable_server =
-    authdir && !from_cache && !from_fetch &&
-    router_have_minimum_dir_info();
   networkstatus_vote_t *consensus = networkstatus_get_latest_consensus();
   const smartlist_t *networkstatus_v2_list = networkstatus_get_v2_list();
   int in_consensus = 0;
@@ -2648,45 +2643,25 @@
       return -1;
     } else {
       /* Same key, new. */
-      int unreachable = 0;
       log_debug(LD_DIR, "Replacing entry for router '%s/%s' [%s]",
                 router->nickname, old_router->nickname,
                 hex_str(id_digest,DIGEST_LEN));
       if (router->addr == old_router->addr &&
           router->or_port == old_router->or_port) {
-        /* these carry over when the address and orport are unchanged.*/
+        /* these carry over when the address and orport are unchanged. */
         router->last_reachable = old_router->last_reachable;
         router->testing_since = old_router->testing_since;
-        router->num_unreachable_notifications =
-          old_router->num_unreachable_notifications;
       }
-      if (authdir_may_warn_about_unreachable_server &&
-          dirserv_thinks_router_is_blatantly_unreachable(router, time(NULL))) {
-        if (router->num_unreachable_notifications >= 3) {
-          unreachable = 1;
-          log_notice(LD_DIR, "Notifying server '%s' that it's unreachable. "
-                     "(ContactInfo '%s', platform '%s').",
-                     router->nickname,
-                     router->contact_info ? router->contact_info : "",
-                     router->platform ? router->platform : "");
-        } else {
-          log_info(LD_DIR,"'%s' may be unreachable -- the %d previous "
-                   "descriptors were thought to be unreachable.",
-                   router->nickname, router->num_unreachable_notifications);
-          router->num_unreachable_notifications++;
-        }
-      }
       routerlist_replace(routerlist, old_router, router);
       if (!from_cache) {
         signed_desc_append_to_journal(&router->cache_info,
                                       &routerlist->desc_store);
       }
       directory_set_dirty();
-      *msg = unreachable ? "Dirserver believes your ORPort is unreachable" :
-        authdir_believes_valid ? "Valid server updated" :
+      *msg = authdir_believes_valid ? "Valid server updated" :
         ("Invalid server updated. (This dirserver is marking your "
          "server as unapproved.)");
-      return unreachable ? 1 : 0;
+      return 0;
     }
   }
 



More information about the tor-commits mailing list