mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-20 10:12:15 +01:00
When we switched to using v3 directories, we threw away the part of
the "do we have enough directory info?" calculation that checked how many relays we believed to still be running based on our own experience. So if we went offline, we never gave up trying to make new circuits; worse, when we came back online we didn't recognize that we should give all the relays another chance. Bugfix on 0.2.0.9-alpha; fixes bugs 648 and 675. svn:r14970
This commit is contained in:
parent
6782682ac6
commit
ca416a78e3
@ -1,4 +1,13 @@
|
||||
Changes in version 0.2.1.1-alpha - 2008-??-??
|
||||
o Major bugfixes:
|
||||
- When we switched to using v3 directories, we threw away the part of
|
||||
the "do we have enough directory info?" calculation that checked
|
||||
how many relays we believed to still be running based on our own
|
||||
experience. So if we went offline, we never gave up trying to make
|
||||
new circuits; worse, when we came back online we didn't recognize
|
||||
that we should give all the relays another chance. Bugfix on
|
||||
0.2.0.9-alpha; fixes bugs 648 and 675.
|
||||
|
||||
o Minor bugfixes:
|
||||
- Stop giving double-close warn when we reject an address for client DNS.
|
||||
- On Windows, correctly detect errors when listing the contents of a
|
||||
|
@ -4189,10 +4189,11 @@ get_dir_info_status_string(void)
|
||||
static void
|
||||
update_router_have_minimum_dir_info(void)
|
||||
{
|
||||
int num_present = 0, num_usable=0;
|
||||
int num_present = 0, num_usable=0, num_running=0;
|
||||
time_t now = time(NULL);
|
||||
int res;
|
||||
or_options_t *options = get_options();
|
||||
routerinfo_t *ri;
|
||||
const networkstatus_t *consensus =
|
||||
networkstatus_get_reasonably_live_consensus(now);
|
||||
|
||||
@ -4218,9 +4219,13 @@ update_router_have_minimum_dir_info(void)
|
||||
SMARTLIST_FOREACH(consensus->routerstatus_list, routerstatus_t *, rs,
|
||||
{
|
||||
if (client_would_use_router(rs, now, options)) {
|
||||
++num_usable;
|
||||
if (router_get_by_digest(rs->identity_digest)) {
|
||||
++num_present;
|
||||
++num_usable; /* the consensus says we want it. */
|
||||
/* XXX021 shouldn't we look up by descriptor digest? */
|
||||
ri = router_get_by_digest(rs->identity_digest);
|
||||
if (ri) {
|
||||
++num_present; /* we have some descriptor for it. */
|
||||
if (ri->is_running)
|
||||
++num_running; /* our local status says it's still up. */
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -4229,10 +4234,10 @@ update_router_have_minimum_dir_info(void)
|
||||
tor_snprintf(dir_info_status, sizeof(dir_info_status),
|
||||
"We have only %d/%d usable descriptors.", num_present, num_usable);
|
||||
res = 0;
|
||||
} else if (num_present < 2) {
|
||||
} else if (num_running < 2) {
|
||||
tor_snprintf(dir_info_status, sizeof(dir_info_status),
|
||||
"Only %d usable descriptor%s known!", num_present,
|
||||
num_present ? "" : "s");
|
||||
"Only %d descriptor%s believed reachable!", num_running,
|
||||
num_running ? "" : "s");
|
||||
res = 0;
|
||||
} else {
|
||||
res = 1;
|
||||
@ -4247,7 +4252,7 @@ update_router_have_minimum_dir_info(void)
|
||||
if (!res && have_min_dir_info) {
|
||||
log(LOG_NOTICE, LD_DIR,"Our directory information is no longer up-to-date "
|
||||
"enough to build circuits.%s",
|
||||
num_usable > 2 ? "" : " (Not enough servers seem reachable -- "
|
||||
num_running > 2 ? "" : " (Not enough servers seem reachable -- "
|
||||
"is your network connection down?)");
|
||||
control_event_client_status(LOG_NOTICE, "NOT_ENOUGH_DIR_INFO");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user