[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] also don"t hang up on him if we"re an OR and he"s an authdi...



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

Modified Files:
	main.c or.h router.c 
Log Message:
also don't hang up on him if we're an OR and he's an authdirserver
otherwise we keep getting taken out of the running-routers list


Index: main.c
===================================================================
RCS file: /home/or/cvsroot/src/or/main.c,v
retrieving revision 1.295
retrieving revision 1.296
diff -u -d -r1.295 -r1.296
--- main.c	20 Jul 2004 19:28:02 -0000	1.295
+++ main.c	20 Jul 2004 19:45:29 -0000	1.296
@@ -373,10 +373,11 @@
     routerinfo_t *router = router_get_by_digest(conn->identity_digest);
     if((!connection_state_is_open(conn)) ||
        (!clique_mode() && !circuit_get_by_conn(conn) &&
-       (!router || !server_mode() || strncmp(router->platform, "Tor 0.0.7", 9)))) {
+       (!router || !server_mode() || !router_is_clique_mode(router)))) {
       /* our handshake has expired;
        * or we're not an authdirserver, we have no circuits, and
-       *   either he's an OP, we're an OP, or we're both ORs and he's running 0.0.8,
+       *   either he's an OP, we're an OP, or we're both ORs and he's
+       *   running 0.0.8 and he's not an authdirserver,
        * then kill it. */
       log_fn(LOG_INFO,"Expiring connection to %d (%s:%d).",
              i,conn->address, conn->port);

Index: or.h
===================================================================
RCS file: /home/or/cvsroot/src/or/or.h,v
retrieving revision 1.384
retrieving revision 1.385
diff -u -d -r1.384 -r1.385
--- or.h	20 Jul 2004 10:17:43 -0000	1.384
+++ or.h	20 Jul 2004 19:45:29 -0000	1.385
@@ -1345,6 +1345,7 @@
 void rotate_onion_key(void);
 
 void router_retry_connections(void);
+int router_is_clique_mode(routerinfo_t *router);
 void router_upload_dir_desc_to_dirservers(void);
 int router_compare_to_my_exit_policy(connection_t *conn);
 routerinfo_t *router_get_my_routerinfo(void);

Index: router.c
===================================================================
RCS file: /home/or/cvsroot/src/or/router.c,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -d -r1.65 -r1.66
--- router.c	20 Jul 2004 10:17:43 -0000	1.65
+++ router.c	20 Jul 2004 19:45:29 -0000	1.66
@@ -368,6 +368,14 @@
   }
 }
 
+int router_is_clique_mode(routerinfo_t *router) {
+  if(router->is_trusted_dir)
+    return 1;
+  if(!strncmp(router->platform, "Tor 0.0.7", 9))
+    return 1;
+  return 0;
+}
+
 /*
  * OR descriptor generation.
  */