[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] i appear to have backported the detect-if-offline code, so ...
- To: or-cvs@xxxxxxxxxxxxx
- Subject: [or-cvs] i appear to have backported the detect-if-offline code, so ...
- From: arma@xxxxxxxx (Roger Dingledine)
- Date: Mon, 10 Jan 2005 12:46:13 -0500 (EST)
- Delivered-to: archiver@seul.org
- Delivered-to: or-cvs-outgoing@seul.org
- Delivered-to: or-cvs@seul.org
- Delivery-date: Mon, 10 Jan 2005 12:46:35 -0500
- Reply-to: or-dev@xxxxxxxxxxxxx
- Sender: owner-or-cvs@xxxxxxxxxxxxx
Update of /home2/or/cvsroot/tor/src/or
In directory moria.mit.edu:/home2/arma/work/onion/0091/tor/src/or
Modified Files:
Tag: tor-0_0_9-patches
directory.c
Log Message:
i appear to have backported the detect-if-offline code, so backport
the check-all-dir-mirrors-before-assuming-offline code too.
Index: directory.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/directory.c,v
retrieving revision 1.181.2.6
retrieving revision 1.181.2.7
diff -u -d -r1.181.2.6 -r1.181.2.7
--- directory.c 10 Jan 2005 04:36:47 -0000 1.181.2.6
+++ directory.c 10 Jan 2005 17:46:11 -0000 1.181.2.7
@@ -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));
+ }
}
}