Browse Source

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.


svn:r8272

Roger Dingledine 19 years ago
parent
commit
2a4d5782ef
1 changed files with 5 additions and 2 deletions
  1. 5 2
      src/or/main.c

+ 5 - 2
src/or/main.c

@@ -597,8 +597,11 @@ run_connection_housekeeping(int i, time_t now)
   }
 
   /* 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