[or-cvs] if you"re a server and the auth dirservers are down, go to ...
Roger Dingledine
arma at seul.org
Mon Jan 10 17:39:43 UTC 2005
Update of /home2/or/cvsroot/tor/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/tor/src/or
Modified Files:
directory.c
Log Message:
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.
Index: directory.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/directory.c,v
retrieving revision 1.190
retrieving revision 1.191
diff -u -d -r1.190 -r1.191
--- directory.c 7 Jan 2005 15:57:57 -0000 1.190
+++ directory.c 10 Jan 2005 17:39:41 -0000 1.191
@@ -153,14 +153,17 @@
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 @@
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));
+ }
}
}
More information about the tor-commits
mailing list