summaryrefslogtreecommitdiff
path: root/src/or/directory.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-11-29 21:01:34 +0000
committerNick Mathewson <nickm@torproject.org>2004-11-29 21:01:34 +0000
commitaff512268563c7c9b0d675a85c7c03bb3ca628ad (patch)
tree6185317b76ea8c90dd23eff73ec589603821d061 /src/or/directory.c
parentb6b07d1d98878cb90aff4cddbcbe860d6b71d285 (diff)
downloadtor-aff512268563c7c9b0d675a85c7c03bb3ca628ad.tar.gz
tor-aff512268563c7c9b0d675a85c7c03bb3ca628ad.zip
Fetch cached running-routers from servers that serve it (that is, authdirservers, and servers running 0.0.9rc5-cvs or later.)
svn:r3018
Diffstat (limited to 'src/or/directory.c')
-rw-r--r--src/or/directory.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/or/directory.c b/src/or/directory.c
index 21f50f1c53..441798e24c 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -152,21 +152,22 @@ directory_get_from_dirserver(uint8_t purpose, const char *resource)
trusted_dir_server_t *ds = NULL;
int fascistfirewall = get_options()->FascistFirewall;
- if (purpose == DIR_PURPOSE_FETCH_DIR) {
+ if (purpose == DIR_PURPOSE_FETCH_DIR ||
+ purpose == DIR_PURPOSE_FETCH_RUNNING_LIST) {
if (advertised_server_mode()) {
/* only ask authdirservers, and don't ask myself */
ds = router_pick_trusteddirserver(1, fascistfirewall);
} else {
/* anybody with a non-zero dirport will do */
- r = router_pick_directory_server(1, fascistfirewall);
+ r = router_pick_directory_server(1, fascistfirewall,
+ purpose==DIR_PURPOSE_FETCH_RUNNING_LIST);
if (!r) {
- log_fn(LOG_INFO, "No router found for directory; falling back to dirserver list");
+ log_fn(LOG_INFO, "No router found for %s; falling back to dirserver list",
+ purpose == DIR_PURPOSE_FETCH_RUNNING_LIST
+ ? "status list" : "directory");
ds = router_pick_trusteddirserver(1, fascistfirewall);
}
}
- } else if (purpose == DIR_PURPOSE_FETCH_RUNNING_LIST) {
- /* right now, running-routers isn't cached, so ask a trusted directory */
- ds = router_pick_trusteddirserver(0, fascistfirewall);
} else { // (purpose == DIR_PURPOSE_FETCH_RENDDESC)
/* only ask authdirservers, any of them will do */
/* Never use fascistfirewall; we're going via Tor. */