diff options
author | Roger Dingledine <arma@torproject.org> | 2006-08-28 19:34:09 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2006-08-28 19:34:09 +0000 |
commit | e7449e23087082c88338961cad6452f65d686027 (patch) | |
tree | 8887da75dd2ee3cba2112396df20dd8ecb7a1a72 | |
parent | 4853b4b037512295f362050f62367dbfc5d787aa (diff) | |
download | tor-e7449e23087082c88338961cad6452f65d686027.tar.gz tor-e7449e23087082c88338961cad6452f65d686027.zip |
Backport: Allow really slow clients to not hang up five minutes
into their directory downloads (suggested by Adam J. Richter).
svn:r8274
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | src/or/main.c | 8 | ||||
-rw-r--r-- | src/or/or.h | 2 |
3 files changed, 20 insertions, 2 deletions
@@ -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 diff --git a/src/or/main.c b/src/or/main.c index c897b0d0b3..336de8b5a7 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -625,9 +625,13 @@ run_connection_housekeeping(int i, time_t now) 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 diff --git a/src/or/or.h b/src/or/or.h index 20e18e55df..b529fcb617 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -320,6 +320,8 @@ typedef enum { #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 |