From: Nick Mathewson Date: Wed, 10 Nov 2004 14:28:47 +0000 (+0000) Subject: Resolve FIXME items: make the kill-unattached-AP timeout symbolic X-Git-Tag: debian-version-0.0.8+0.0.9pre5-2~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a43db78e8de38a81838a1db0680105d6f73d41d4;p=thirdparty%2Ftor.git Resolve FIXME items: make the kill-unattached-AP timeout symbolic svn:r2793 --- diff --git a/src/or/circuituse.c b/src/or/circuituse.c index 0b5ccc9d9b..de20f7fcdd 100644 --- a/src/or/circuituse.c +++ b/src/or/circuituse.c @@ -11,6 +11,9 @@ #include "or.h" +/** Longest time to wait for a circuit before closing an AP connection */ +#define CONN_AP_MAX_ATTACH_DELAY 60 + /********* START VARIABLES **********/ extern circuit_t *global_circuitlist; /* from circuitlist.c */ @@ -764,8 +767,7 @@ int connection_ap_handshake_attach_circuit(connection_t *conn) { tor_assert(conn->socks_request); conn_age = time(NULL) - conn->timestamp_created; - if(conn_age > 60) { - /* XXX make this cleaner than '60' */ + if(conn_age > CONN_AP_MAX_ATTACH_DELAY) { log_fn(LOG_WARN,"Giving up on unattached conn (%d sec old).", conn_age); return -1; }