summaryrefslogtreecommitdiff
path: root/src/or/circuituse.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2007-08-19 07:17:40 +0000
committerRoger Dingledine <arma@torproject.org>2007-08-19 07:17:40 +0000
commit8641439a6e9cda90fae7771e754a70ba56100b09 (patch)
treeb8c6dfbb9e3532e3dd8d2f3eed364a60ddc16a70 /src/or/circuituse.c
parentd6aa617e07d1b09d3d4e1aff2b57fb1192d6f625 (diff)
downloadtor-8641439a6e9cda90fae7771e754a70ba56100b09.tar.gz
tor-8641439a6e9cda90fae7771e754a70ba56100b09.zip
backport candidate (revert part of r9350):
Expire application streams in all cases if they've been around longer than SocksTimeout. Right now there are some cases where the stream will live forever, demanding a new circuit every 15 seconds. Bugfix on 0.1.2.7-alpha; fixes bug 454; reported by lodger. svn:r11186
Diffstat (limited to 'src/or/circuituse.c')
-rw-r--r--src/or/circuituse.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index ee9f7cae95..4bf261fb5d 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -1259,6 +1259,16 @@ connection_ap_handshake_attach_circuit(edge_connection_t *conn)
conn_age = time(NULL) - conn->_base.timestamp_created;
+ if (conn_age >= get_options()->SocksTimeout) {
+ int severity = (!conn->_base.addr && !conn->_base.port) ?
+ LOG_INFO : LOG_NOTICE;
+ log_fn(severity, LD_APP,
+ "Tried for %d seconds to get a connection to %s:%d. Giving up.",
+ conn_age, safe_str(conn->socks_request->address),
+ conn->socks_request->port);
+ return -1;
+ }
+
if (!connection_edge_is_rendezvous_stream(conn)) { /* we're a general conn */
origin_circuit_t *circ=NULL;