[or-cvs] r11186: backport candidate (revert part of r9350): Expire applicatio (in tor/trunk: . src/or)

arma at seul.org arma at seul.org
Sun Aug 19 07:17:40 UTC 2007


Author: arma
Date: 2007-08-19 03:17:40 -0400 (Sun, 19 Aug 2007)
New Revision: 11186

Modified:
   tor/trunk/ChangeLog
   tor/trunk/src/or/circuituse.c
Log:
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.


Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2007-08-19 07:06:02 UTC (rev 11185)
+++ tor/trunk/ChangeLog	2007-08-19 07:17:40 UTC (rev 11186)
@@ -18,6 +18,12 @@
       non-standard behavior tended to annoy people who have built other
       programs.
 
+  o Major bugfixes (stream expiration):
+    - 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.
+
   o Minor features (directory servers):
     - When somebody requests a list of statuses or servers, and we have
       none of those, return a 404 rather than an empty 200.

Modified: tor/trunk/src/or/circuituse.c
===================================================================
--- tor/trunk/src/or/circuituse.c	2007-08-19 07:06:02 UTC (rev 11185)
+++ tor/trunk/src/or/circuituse.c	2007-08-19 07:17:40 UTC (rev 11186)
@@ -1259,6 +1259,16 @@
 
   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;
 



More information about the tor-commits mailing list