[or-cvs] if connecting to an OR fails immediately, mark it as down

Roger Dingledine arma at seul.org
Mon Jul 12 18:19:58 UTC 2004


Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/src/or

Modified Files:
	connection.c connection_or.c routerlist.c 
Log Message:
if connecting to an OR fails immediately, mark it as down


Index: connection.c
===================================================================
RCS file: /home/or/cvsroot/src/or/connection.c,v
retrieving revision 1.235
retrieving revision 1.236
diff -u -d -r1.235 -r1.236
--- connection.c	4 Jul 2004 22:48:11 -0000	1.235
+++ connection.c	12 Jul 2004 18:19:55 -0000	1.236
@@ -829,7 +829,9 @@
         log_fn(LOG_DEBUG,"in-progress connect failed. Removing.");
         connection_close_immediate(conn);
         connection_mark_for_close(conn);
-        /* Previously we tested conn->nickname; is this right? */
+        /* it's safe to pass OPs to router_mark_as_down(), since it just
+         * ignores unrecognized routers
+         */
         if (conn->type == CONN_TYPE_OR)
           router_mark_as_down(conn->identity_digest);
         return -1;

Index: connection_or.c
===================================================================
RCS file: /home/or/cvsroot/src/or/connection_or.c,v
retrieving revision 1.113
retrieving revision 1.114
diff -u -d -r1.113 -r1.114
--- connection_or.c	2 Jul 2004 23:40:03 -0000	1.113
+++ connection_or.c	12 Jul 2004 18:19:55 -0000	1.114
@@ -177,6 +177,7 @@
 
   switch(connection_connect(conn, conn->address, addr, port)) {
     case -1:
+      router_mark_as_down(conn->identity_digest);
       connection_free(conn);
       return NULL;
     case 0:

Index: routerlist.c
===================================================================
RCS file: /home/or/cvsroot/src/or/routerlist.c,v
retrieving revision 1.94
retrieving revision 1.95
diff -u -d -r1.94 -r1.95
--- routerlist.c	4 Jul 2004 22:48:11 -0000	1.94
+++ routerlist.c	12 Jul 2004 18:19:55 -0000	1.95
@@ -354,7 +354,7 @@
   tor_free(rl);
 }
 
-/** Mark the router named <b>nickname</b> as non-running in our routerlist. */
+/** Mark the router with ID <b>digest</b> as non-running in our routerlist. */
 void router_mark_as_down(const char *digest) {
   routerinfo_t *router;
   tor_assert(digest);



More information about the tor-commits mailing list