aboutsummaryrefslogtreecommitdiff
path: root/src/or/main.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-04-18 06:35:31 +0000
committerRoger Dingledine <arma@torproject.org>2004-04-18 06:35:31 +0000
commit7a7baf0552c39414426240c01f02b6dd7dde1326 (patch)
tree54ec0ddf5cf062aed273c133bbdeb93f51a7f654 /src/or/main.c
parentff261f78f218de7bf1d9777282024951921e9159 (diff)
downloadtor-7a7baf0552c39414426240c01f02b6dd7dde1326.tar
tor-7a7baf0552c39414426240c01f02b6dd7dde1326.tar.gz
expire dir connections that live for more than 5 minutes
svn:r1663
Diffstat (limited to 'src/or/main.c')
-rw-r--r--src/or/main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/or/main.c b/src/or/main.c
index c80737bf5..5276f0862 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -306,6 +306,13 @@ static void run_connection_housekeeping(int i, time_t now) {
cell_t cell;
connection_t *conn = connection_array[i];
+ if(conn->type == CONN_TYPE_DIR &&
+ conn->timestamp_created + 5*60 > now) {
+ log_fn(LOG_INFO,"Expiring wedged directory conn (purpose %d)", conn->purpose);
+ connection_mark_for_close(conn,0);
+ return;
+ }
+
/* check connections to see whether we should send a keepalive, expire, or wait */
if(!connection_speaks_cells(conn))
return;