summaryrefslogtreecommitdiff
path: root/src/or/directory.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-12-11 19:12:48 +0000
committerNick Mathewson <nickm@torproject.org>2008-12-11 19:12:48 +0000
commit043b4fc59e635015dc7fc758d44ba298b8278f4a (patch)
treed139f6f67af83b9cc5866415e0e2d0795b474aaa /src/or/directory.c
parent29f5a65a166cd06879ef55b7b5a38ae88c40482f (diff)
downloadtor-043b4fc59e635015dc7fc758d44ba298b8278f4a.tar.gz
tor-043b4fc59e635015dc7fc758d44ba298b8278f4a.zip
Add a PDS_ flag to exclude authorities from which we are fetching descs.
Yes, this is maybe a little overspecific. Part of a bug 366 fix. svn:r17593
Diffstat (limited to 'src/or/directory.c')
-rw-r--r--src/or/directory.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/or/directory.c b/src/or/directory.c
index fd609ea9a6..e74119c0e6 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -368,6 +368,22 @@ directory_get_from_dirserver(uint8_t dir_purpose, uint8_t router_purpose,
if (prefer_authority || type == BRIDGE_AUTHORITY) {
/* only ask authdirservers, and don't ask myself */
rs = router_pick_trusteddirserver(type, pds_flags);
+ if (rs == NULL && (pds_flags & PDS_NO_EXISTING_SERVERDESC_FETCH)) {
+ /* We don't want to fetch from any authorities that we're currently
+ * fetching server descriptors from, and we got no match. Did we
+ * get no match because all the authorities have connections
+ * fetching server descriptors (in which case we should just
+ * return,) or because all the authorities are down or on fire or
+ * unreachable or something (in which case we should go on with
+ * our fallback code)? */
+ pds_flags &= ~PDS_NO_EXISTING_SERVERDESC_FETCH;
+ rs = router_pick_trusteddirserver(type, pds_flags);
+ if (rs) {
+ log_debug(LD_DIR, "Deferring serverdesc fetch: all authorities "
+ "are in use.");
+ return;
+ }
+ }
}
if (!rs && type != BRIDGE_AUTHORITY) {
/* anybody with a non-zero dirport will do */