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

[or-cvs] r8274: Backport: Allow really slow clients to not hang up five minu (in tor/branches/tor-0_1_1-patches: . src/or)



Author: arma
Date: 2006-08-28 15:34:09 -0400 (Mon, 28 Aug 2006)
New Revision: 8274

Modified:
   tor/branches/tor-0_1_1-patches/ChangeLog
   tor/branches/tor-0_1_1-patches/src/or/main.c
   tor/branches/tor-0_1_1-patches/src/or/or.h
Log:
Backport: Allow really slow clients to not hang up five minutes
into their directory downloads (suggested by Adam J. Richter).


Modified: tor/branches/tor-0_1_1-patches/ChangeLog
===================================================================
--- tor/branches/tor-0_1_1-patches/ChangeLog	2006-08-28 19:02:57 UTC (rev 8273)
+++ tor/branches/tor-0_1_1-patches/ChangeLog	2006-08-28 19:34:09 UTC (rev 8274)
@@ -1,3 +1,15 @@
+Changes in version 0.1.1.24 - 2006-09-xx [ongoing]
+  o Major bugfixes:
+    - Allow really slow clients to not hang up five minutes into their
+      directory downloads (suggested by Adam J. Richter).
+
+  o Minor bugfixes:
+    - Allow Tor to start when RunAsDaemon is set but no logs are set.
+    - Fix configure.in to not produce broken configure files with
+      more recent versions of autoconf. Thanks to Clint for his auto*
+      voodoo.
+
+
 Changes in version 0.1.1.23 - 2006-07-30
   o Major bugfixes:
     - Fast Tor servers, especially exit nodes, were triggering asserts

Modified: tor/branches/tor-0_1_1-patches/src/or/main.c
===================================================================
--- tor/branches/tor-0_1_1-patches/src/or/main.c	2006-08-28 19:02:57 UTC (rev 8273)
+++ tor/branches/tor-0_1_1-patches/src/or/main.c	2006-08-28 19:34:09 UTC (rev 8274)
@@ -625,9 +625,13 @@
     return;
   }
 
-  /* Expire any directory connections that haven't sent anything for 5 min */
+  /* Expire any directory connections that haven't been active (sent
+   * if a server or received if a client) for 5 min */
   if (conn->type == CONN_TYPE_DIR &&
-      conn->timestamp_lastwritten + DIR_CONN_MAX_STALL < now) {
+      ((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

Modified: tor/branches/tor-0_1_1-patches/src/or/or.h
===================================================================
--- tor/branches/tor-0_1_1-patches/src/or/or.h	2006-08-28 19:02:57 UTC (rev 8273)
+++ tor/branches/tor-0_1_1-patches/src/or/or.h	2006-08-28 19:34:09 UTC (rev 8274)
@@ -320,6 +320,8 @@
 #define DIR_CONN_STATE_SERVER_WRITING 6
 #define _DIR_CONN_STATE_MAX 6
 
+#define DIR_CONN_IS_SERVER(conn) ((conn)->purpose == DIR_PURPOSE_SERVER)
+
 #define _CONTROL_CONN_STATE_MIN 1
 #define CONTROL_CONN_STATE_OPEN_V0 1
 #define CONTROL_CONN_STATE_OPEN_V1 2