aboutsummaryrefslogtreecommitdiff
path: root/src/or/dirserv.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2006-03-12 20:57:52 +0000
committerRoger Dingledine <arma@torproject.org>2006-03-12 20:57:52 +0000
commit1fc5eb329bc6618af6bcafa313cfad8798c409c5 (patch)
treed6bf08a209fbb2a1cadbb5326cbc32b5823787cc /src/or/dirserv.c
parentef447507ffa32d5857f1ea6583ba5c39e3b96ed0 (diff)
downloadtor-1fc5eb329bc6618af6bcafa313cfad8798c409c5.tar
tor-1fc5eb329bc6618af6bcafa313cfad8798c409c5.tar.gz
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
Diffstat (limited to 'src/or/dirserv.c')
-rw-r--r--src/or/dirserv.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index 0ae6ed6c6..93318fb01 100644
--- a/src/or/dirserv.c
+++ b/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;