浏览代码

don't whine about reachability if the guy is hibernating now.

speaking of which, we don't actually parse is_hibernating out
of the router descriptor right now. nick, can you fix this?


svn:r4886
Roger Dingledine 20 年之前
父节点
当前提交
4240410a9d
共有 2 个文件被更改,包括 4 次插入1 次删除
  1. 2 0
      src/or/dirserv.c
  2. 2 1
      src/or/or.h

+ 2 - 0
src/or/dirserv.c

@@ -508,6 +508,8 @@ static int
 dirserv_thinks_router_is_blatantly_unreachable(routerinfo_t *router, time_t now)
 {
   connection_t *conn;
+  if (router->is_hibernating)
+    return 0;
   conn = connection_get_by_identity_digest(router->identity_digest,
                                            CONN_TYPE_OR);
   if (conn && conn->state == OR_CONN_STATE_OPEN &&

+ 2 - 1
src/or/or.h

@@ -736,6 +736,7 @@ typedef struct {
   addr_policy_t *exit_policy; /**< What streams will this OR permit
                                       * to exit? */
   long uptime; /**< How many seconds the router claims to have been up */
+  uint8_t is_hibernating; /**< Whether the router claims to be hibernating */
   smartlist_t *declared_family; /**< Nicknames of router which this router
                                  * claims are its family. */
   char *contact_info; /**< Declared contact info for this router. */
@@ -747,7 +748,7 @@ typedef struct {
                     * (For Authdir: Have we validated this OR?)
                     */
 
-  /* The below items are used only by authdirservers right now for
+  /* The below items are used only by authdirservers for
    * reachability testing. */
   time_t last_reachable; /**< When was the last time we could reach this OR? */
   time_t testing_since; /**< When did we start testing reachability for this OR? */