[or-cvs] r12527: get rid of the separate reachability window for the hsdir fl (tor/trunk/src/or)
arma at seul.org
arma at seul.org
Sat Nov 17 12:15:32 UTC 2007
Author: arma
Date: 2007-11-17 07:15:32 -0500 (Sat, 17 Nov 2007)
New Revision: 12527
Modified:
tor/trunk/src/or/dirserv.c
tor/trunk/src/or/or.h
Log:
get rid of the separate reachability window for the hsdir flag.
Modified: tor/trunk/src/or/dirserv.c
===================================================================
--- tor/trunk/src/or/dirserv.c 2007-11-17 12:11:00 UTC (rev 12526)
+++ tor/trunk/src/or/dirserv.c 2007-11-17 12:15:32 UTC (rev 12527)
@@ -1537,9 +1537,12 @@
return 0;
}
-/** Return true if <b>router</b> has an uptime of at least
- * <b>__MinUptimeHidServDirectoryV2</b> and is reachable in the last
- * REND_HS_DIR_REACHABLE_TIMEOUT seconds, else false.
+/** Return true iff <b>router</b> should be assigned the "HSDir" flag.
+ * Right now this means it advertises support for it, it has a high
+ * uptime, and it's currently considered Running.
+ *
+ * This function needs to be called after router->is_running has
+ * been set.
*/
static int
dirserv_thinks_router_is_hs_dir(routerinfo_t *router, time_t now)
@@ -1548,8 +1551,7 @@
return (router->wants_to_be_hs_dir &&
uptime > get_options()->__MinUptimeHidServDirectoryV2 &&
- ((router_is_me(router) && !we_are_hibernating()) ||
- (now < router->last_reachable + REND_HS_DIR_REACHABLE_TIMEOUT)));
+ router->is_running);
}
/** Look through the routerlist, and assign the median uptime of running valid
Modified: tor/trunk/src/or/or.h
===================================================================
--- tor/trunk/src/or/or.h 2007-11-17 12:11:00 UTC (rev 12526)
+++ tor/trunk/src/or/or.h 2007-11-17 12:15:32 UTC (rev 12527)
@@ -608,10 +608,6 @@
* in the ring) for a descriptor. */
#define REND_NUMBER_OF_NON_CONSECUTIVE_REPLICAS 2
-/** Maximum time that an onion router may not respond unless taken
- * from the list of hidden service directories. */
-#define REND_HS_DIR_REACHABLE_TIMEOUT (45*60)
-
/** Number of consecutive replicas for a descriptor. */
#define REND_NUMBER_OF_CONSECUTIVE_REPLICAS 3
More information about the tor-commits
mailing list