[or-cvs] Backport fix for win32 directory retry bug.
Nick Mathewson
nickm at seul.org
Mon Jan 3 19:53:37 UTC 2005
Update of /home/or/cvsroot/tor/src/or
In directory moria.mit.edu:/tmp/cvs-serv28467/src/or
Modified Files:
Tag: tor-0_0_9-patches
connection.c
Log Message:
Backport fix for win32 directory retry bug.
Index: connection.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/connection.c,v
retrieving revision 1.310
retrieving revision 1.310.2.1
diff -u -d -r1.310 -r1.310.2.1
--- connection.c 13 Dec 2004 00:44:38 -0000 1.310
+++ connection.c 3 Jan 2005 19:53:35 -0000 1.310.2.1
@@ -205,6 +205,17 @@
switch (conn->type) {
case CONN_TYPE_DIR:
+ if (conn->state == DIR_CONN_STATE_CONNECTING) {
+ /* it's a directory server and connecting failed: forget about
+ this router */
+ router_mark_as_down(conn->identity_digest);
+ if (conn->purpose == DIR_PURPOSE_FETCH_DIR &&
+ !all_trusted_directory_servers_down()) {
+ log_fn(LOG_INFO,"Giving up on dirserver %s; trying another.",
+ conn->address);
+ directory_get_from_dirserver(DIR_PURPOSE_FETCH_DIR, NULL);
+ }
+ }
if (conn->purpose == DIR_PURPOSE_FETCH_RENDDESC)
rend_client_desc_fetched(conn->rend_query, 0);
break;
@@ -854,17 +865,6 @@
conn->cpath_layer);
}
connection_mark_for_close(conn);
- if (conn->type == CONN_TYPE_DIR &&
- conn->state == DIR_CONN_STATE_CONNECTING) {
- /* it's a directory server and connecting failed: forget about this router */
- /* XXX I suspect pollerr may make Windows not get to this point. :( */
- router_mark_as_down(conn->identity_digest);
- if (conn->purpose == DIR_PURPOSE_FETCH_DIR &&
- !all_trusted_directory_servers_down()) {
- log_fn(LOG_INFO,"Giving up on dirserver %s; trying another.", conn->address);
- directory_get_from_dirserver(DIR_PURPOSE_FETCH_DIR, NULL);
- }
- }
return -1;
}
if (CONN_IS_EDGE(conn) &&
More information about the tor-commits
mailing list