diff options
author | Roger Dingledine <arma@torproject.org> | 2006-08-28 19:00:17 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2006-08-28 19:00:17 +0000 |
commit | 2a4d5782ef50fc4c474a21573a8854490afd8e9a (patch) | |
tree | d1f0e73782e7081994e716ae8bd93e4180a6e2df /src/or/main.c | |
parent | f75ef94f2732c9223ccb815d126c07544bd18bb8 (diff) | |
download | tor-2a4d5782ef50fc4c474a21573a8854490afd8e9a.tar tor-2a4d5782ef50fc4c474a21573a8854490afd8e9a.tar.gz |
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
Diffstat (limited to 'src/or/main.c')
-rw-r--r-- | src/or/main.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/or/main.c b/src/or/main.c index d10996b69..17ef1b76a 100644 --- a/src/or/main.c +++ b/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 |