summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-04-17 12:09:19 -0400
committerNick Mathewson <nickm@torproject.org>2012-04-17 17:18:59 -0400
commit0b1ec16058f51cfa68da845507d1c30110cfff52 (patch)
treef437d26c0d6a688cee6580d56a72c67e017db790
parent5d7fab947787db42963eb52809e31008d7a6b0e1 (diff)
downloadtor-0b1ec16058f51cfa68da845507d1c30110cfff52.tar.gz
tor-0b1ec16058f51cfa68da845507d1c30110cfff52.zip
Don't fetch v2 networkstatuses from caches, even if auths are down
Fix for 5635; fix on 0.2.2.26-beta, where caches stopped fetching this information.
-rw-r--r--changes/bug56356
-rw-r--r--src/or/directory.c7
2 files changed, 13 insertions, 0 deletions
diff --git a/changes/bug5635 b/changes/bug5635
new file mode 100644
index 0000000000..9c2e729672
--- /dev/null
+++ b/changes/bug5635
@@ -0,0 +1,6 @@
+ o Major bugfixes (directory authorities):
+ - If authorities are unable to get a set of v2 consensus documents
+ from other directory authorities, they no longer fail-back and try
+ to fetch them from regular directory caches. This is a bugfix on
+ 0.2.2.26-beta, where routers stopped downloading v2 consensus
+ documents entirely. Fix for bug #5635.
diff --git a/src/or/directory.c b/src/or/directory.c
index fbde7859e8..6394aece71 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -354,6 +354,7 @@ directory_get_from_dirserver(uint8_t dir_purpose, uint8_t router_purpose,
const routerstatus_t *rs = NULL;
const or_options_t *options = get_options();
int prefer_authority = directory_fetches_from_authorities(options);
+ int require_authority = 0;
int get_via_tor = purpose_needs_anonymity(dir_purpose, router_purpose);
dirinfo_type_t type;
time_t if_modified_since = 0;
@@ -369,6 +370,7 @@ directory_get_from_dirserver(uint8_t dir_purpose, uint8_t router_purpose,
case DIR_PURPOSE_FETCH_V2_NETWORKSTATUS:
type = V2_DIRINFO;
prefer_authority = 1; /* Only v2 authorities have these anyway. */
+ require_authority = 1; /* Don't fallback to asking a non-authority */
break;
case DIR_PURPOSE_FETCH_SERVERDESC:
type = (router_purpose == ROUTER_PURPOSE_BRIDGE ? BRIDGE_DIRINFO :
@@ -469,6 +471,11 @@ directory_get_from_dirserver(uint8_t dir_purpose, uint8_t router_purpose,
return;
}
}
+ if (rs == NULL && require_authority) {
+ log_info(LD_DIR, "No authorities were available for %s: will try "
+ "later.", dir_conn_purpose_to_string(dir_purpose));
+ return;
+ }
}
if (!rs && type != BRIDGE_DIRINFO) {
/* anybody with a non-zero dirport will do */