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
This commit is contained in:
Roger Dingledine 2006-08-28 19:00:17 +00:00
parent f75ef94f27
commit 2a4d5782ef

View File

@ -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