[or-cvs] We screwed up in anticipating how to add new dirservers:

arma at seul.org arma at seul.org
Sun Mar 12 20:57:54 UTC 2006


Update of /home2/or/cvsroot/tor/src/or
In directory moria:/home/arma/work/onion/cvs/tor/src/or

Modified Files:
	dirserv.c 
Log Message:
We screwed up in anticipating how to add new dirservers:
Old servers won't realize they're supposed to stay connected
to the new dirservers, so they'll expire connections to them,
but that means the dirservers will list them as unreachable.

So the fix is to stop requiring an open connection when deciding
if a server is reachable. This makes us slightly less accurate,
but at least it will work.


Index: dirserv.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/dirserv.c,v
retrieving revision 1.301
retrieving revision 1.302
diff -u -p -d -r1.301 -r1.302
--- dirserv.c	11 Mar 2006 02:21:30 -0000	1.301
+++ dirserv.c	12 Mar 2006 20:57:52 -0000	1.302
@@ -694,19 +694,14 @@ list_single_server_status(routerinfo_t *
 
 /** Treat a router as alive if
  *    - It's me, and I'm not hibernating.
- * or - we're connected to it and we've found it reachable recently. */
+ * or - We've found it reachable recently. */
 static int
 dirserv_thinks_router_is_reachable(routerinfo_t *router, time_t now)
 {
-  connection_t *conn;
   if (router_is_me(router) && !we_are_hibernating())
     return 1;
-  conn = connection_or_get_by_identity_digest(
-      router->cache_info.identity_digest);
-  if (conn && conn->state == OR_CONN_STATE_OPEN)
-    return get_options()->AssumeReachable ||
-           now < router->last_reachable + REACHABLE_TIMEOUT;
-  return 0;
+  return get_options()->AssumeReachable ||
+         now < router->last_reachable + REACHABLE_TIMEOUT;
 }
 
 /** Return 1 if we're confident that there's a problem with
@@ -716,13 +711,9 @@ int
 dirserv_thinks_router_is_blatantly_unreachable(routerinfo_t *router,
                                                time_t now)
 {
-  connection_t *conn;
   if (router->is_hibernating)
     return 0;
-  conn = connection_or_get_by_identity_digest(
-    router->cache_info.identity_digest);
-  if (conn && conn->state == OR_CONN_STATE_OPEN &&
-      now >= router->last_reachable + 2*REACHABLE_TIMEOUT &&
+  if (now >= router->last_reachable + 2*REACHABLE_TIMEOUT &&
       router->testing_since &&
       now >= router->testing_since + 2*REACHABLE_TIMEOUT)
     return 1;



More information about the tor-commits mailing list