aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2007-11-17 12:15:32 +0000
committerRoger Dingledine <arma@torproject.org>2007-11-17 12:15:32 +0000
commitd62ef13d0ad720a55591e6b8e77d4c6b2aa7abe5 (patch)
treef79f0dca9ed5d17ae200b08628956a2682a04c05 /src
parentb701583ffaeeb96ea4fc7e4274dde43771783a64 (diff)
downloadtor-d62ef13d0ad720a55591e6b8e77d4c6b2aa7abe5.tar
tor-d62ef13d0ad720a55591e6b8e77d4c6b2aa7abe5.tar.gz
get rid of the separate reachability window for the hsdir flag.
svn:r12527
Diffstat (limited to 'src')
-rw-r--r--src/or/dirserv.c12
-rw-r--r--src/or/or.h4
2 files changed, 7 insertions, 9 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index 27092fdb7..884087170 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -1537,9 +1537,12 @@ dirserv_thinks_router_is_unreliable(time_t now,
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 @@ dirserv_thinks_router_is_hs_dir(routerinfo_t *router, time_t now)
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
diff --git a/src/or/or.h b/src/or/or.h
index 9c23b9ce6..8f077234f 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -608,10 +608,6 @@ typedef enum {
* 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