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

[or-cvs] if you"re an OR and he"s an OR and he"s running 0.0.7,



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

Modified Files:
	main.c 
Log Message:
if you're an OR and he's an OR and he's running 0.0.7,
don't expire your connections to him.


Index: main.c
===================================================================
RCS file: /home/or/cvsroot/src/or/main.c,v
retrieving revision 1.294
retrieving revision 1.295
diff -u -d -r1.294 -r1.295
--- main.c	20 Jul 2004 10:17:43 -0000	1.294
+++ main.c	20 Jul 2004 19:28:02 -0000	1.295
@@ -370,10 +370,14 @@
      the connection or send a keepalive, depending. */
   if(connection_speaks_cells(conn) &&
      now >= conn->timestamp_lastwritten + options.KeepalivePeriod) {
-    if((!clique_mode() && !circuit_get_by_conn(conn)) ||
-       (!connection_state_is_open(conn))) {
-      /* we're an onion proxy, with no circuits;
-       * or our handshake has expired. kill it. */
+    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)))) {
+      /* 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,
+       * then kill it. */
       log_fn(LOG_INFO,"Expiring connection to %d (%s:%d).",
              i,conn->address, conn->port);
       /* flush anything waiting, e.g. a destroy for a just-expired circ */