mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-11 05:33:47 +01:00
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
This commit is contained in:
parent
ef447507ff
commit
1fc5eb329b
@ -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 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;
|
||||
|
Loading…
Reference in New Issue
Block a user