[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r11188: backport r11186 (in tor/branches/tor-0_1_2-patches: . src/or)



Author: arma
Date: 2007-08-19 03:23:54 -0400 (Sun, 19 Aug 2007)
New Revision: 11188

Modified:
   tor/branches/tor-0_1_2-patches/ChangeLog
   tor/branches/tor-0_1_2-patches/src/or/circuituse.c
Log:
backport r11186


Modified: tor/branches/tor-0_1_2-patches/ChangeLog
===================================================================
--- tor/branches/tor-0_1_2-patches/ChangeLog	2007-08-19 07:18:37 UTC (rev 11187)
+++ tor/branches/tor-0_1_2-patches/ChangeLog	2007-08-19 07:23:54 UTC (rev 11188)
@@ -4,6 +4,13 @@
       deprecated since Tor 0.1.1.1-alpha, and keeping it safe and secure
       has been more of a headache than it's worth.
 
+  o Major bugfixes (stream expiration):
+    - Expire not-yet-successful 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 (controller):
     - Add a PROTOCOLINFO controller command. Like AUTHENTICATE, it
       is valid before any authentication has been received. It tells

Modified: tor/branches/tor-0_1_2-patches/src/or/circuituse.c
===================================================================
--- tor/branches/tor-0_1_2-patches/src/or/circuituse.c	2007-08-19 07:18:37 UTC (rev 11187)
+++ tor/branches/tor-0_1_2-patches/src/or/circuituse.c	2007-08-19 07:23:54 UTC (rev 11188)
@@ -1215,6 +1215,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;