[or-cvs] r8272: an even better check -- now servers hang up if they can't wr (tor/trunk/src/or)

arma at seul.org arma at seul.org
Mon Aug 28 19:00:17 UTC 2006


Author: arma
Date: 2006-08-28 15:00:17 -0400 (Mon, 28 Aug 2006)
New Revision: 8272

Modified:
   tor/trunk/src/or/main.c
Log:
an even better check -- now servers hang up if they can't write
for a while, and clients hang up if they can't read for a while.


Modified: tor/trunk/src/or/main.c
===================================================================
--- tor/trunk/src/or/main.c	2006-08-28 18:51:36 UTC (rev 8271)
+++ tor/trunk/src/or/main.c	2006-08-28 19:00:17 UTC (rev 8272)
@@ -597,8 +597,11 @@
   }
 
   /* Expire any directory connections that haven't sent anything for 5 min */
-  if (conn->type == CONN_TYPE_DIR && DIR_CONN_IS_SERVER(conn) &&
-      conn->timestamp_lastwritten + DIR_CONN_MAX_STALL < now) {
+  if (conn->type == CONN_TYPE_DIR &&
+      ((DIR_CONN_IS_SERVER(conn) &&
+        conn->timestamp_lastwritten + DIR_CONN_MAX_STALL < now) ||
+       (!DIR_CONN_IS_SERVER(conn) &&
+        conn->timestamp_lastread + DIR_CONN_MAX_STALL < now))) {
     log_info(LD_DIR,"Expiring wedged directory conn (fd %d, purpose %d)",
              conn->s, conn->purpose);
     /* This check is temporary; it's to let us know whether we should consider



More information about the tor-commits mailing list