diff options
author | Roger Dingledine <arma@torproject.org> | 2005-01-10 17:39:41 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2005-01-10 17:39:41 +0000 |
commit | 45eb8d9660681ef0f948c4c22d38fc4319aa000e (patch) | |
tree | 1b27e591b42c454e419a686facdee2a737821cf3 /src/or/directory.c | |
parent | 74bc4e5af02a569652a2bf4892117bc44887ad0b (diff) | |
download | tor-45eb8d9660681ef0f948c4c22d38fc4319aa000e.tar.gz tor-45eb8d9660681ef0f948c4c22d38fc4319aa000e.zip |
if you're a server and the auth dirservers are down, go to any other
server. only give up hope on network reachability when no other servers
are reachable either.
svn:r3335
Diffstat (limited to 'src/or/directory.c')
-rw-r--r-- | src/or/directory.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/or/directory.c b/src/or/directory.c index c6ec9a58b9..05e354ac7b 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -153,14 +153,17 @@ directory_get_from_dirserver(uint8_t purpose, const char *resource, routerinfo_t *r = NULL; trusted_dir_server_t *ds = NULL; int fascistfirewall = get_options()->FascistFirewall; + int directconn = purpose == DIR_PURPOSE_FETCH_DIR || + purpose == DIR_PURPOSE_FETCH_RUNNING_LIST; + int fetch_fresh_first = advertised_server_mode(); - if (purpose == DIR_PURPOSE_FETCH_DIR || - purpose == DIR_PURPOSE_FETCH_RUNNING_LIST) { - if (advertised_server_mode()) { + if (directconn) { + if (fetch_fresh_first) { /* only ask authdirservers, and don't ask myself */ ds = router_pick_trusteddirserver(1, fascistfirewall, retry_if_no_servers); - } else { + } + if (!ds) { /* anybody with a non-zero dirport will do */ r = router_pick_directory_server(1, fascistfirewall, purpose==DIR_PURPOSE_FETCH_RUNNING_LIST, @@ -184,8 +187,12 @@ directory_get_from_dirserver(uint8_t purpose, const char *resource, else if (ds) directory_initiate_command_trusted_dir(ds, purpose, resource, NULL, 0); else { - log_fn(LOG_NOTICE,"No running dirservers known. Not trying. (purpose %d)", purpose); - directory_all_unreachable(time(NULL)); /* remember we tried them all and failed. */ + log_fn(LOG_NOTICE,"No running dirservers known. Not trying. (purpose %d)", + purpose); + if(directconn) { + /* remember we tried them all and failed. */ + directory_all_unreachable(time(NULL)); + } } } |