소스 검색

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.


svn:r6140

Roger Dingledine 19 년 전
부모
커밋
1fc5eb329b
1개의 변경된 파일4개의 추가작업 그리고 13개의 파일을 삭제
  1. 4 13
      src/or/dirserv.c

+ 4 - 13
src/or/dirserv.c

@@ -694,19 +694,14 @@ list_single_server_status(routerinfo_t *desc, int is_live)
 
 /** 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;