]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Bug 15482: Don't abandon circuits that are still in use for browsing.
authorMike Perry <mikeperry-git@torproject.org>
Fri, 27 Mar 2015 19:57:37 +0000 (12:57 -0700)
committerYawning Angel <yawning@schwanenlied.me>
Tue, 1 Sep 2015 15:21:47 +0000 (15:21 +0000)
Only applies to connections with SOCKS auth set, so that non-web Tor
activity is not affected.

Simpler version of Nick's patch because the randomness worried me, and I'm not
otherwise sure why we want a max here.

src/or/circuituse.c

index a3b71974ca2576dc495324233c16aef33a025c34..e10bb82641297df469ee6da739f5ce3381ab1197 100644 (file)
@@ -2284,8 +2284,15 @@ connection_ap_handshake_attach_chosen_circuit(entry_connection_t *conn,
 
   base_conn->state = AP_CONN_STATE_CIRCUIT_WAIT;
 
-  if (!circ->base_.timestamp_dirty)
-    circ->base_.timestamp_dirty = time(NULL);
+  if (!circ->base_.timestamp_dirty) {
+    circ->base_.timestamp_dirty = approx_time();
+  } else if ((conn->entry_cfg.isolation_flags & ISO_SOCKSAUTH) &&
+             (conn->socks_request->usernamelen ||
+              conn->socks_request->passwordlen)) {
+    /* When stream isolation is in use and controlled by an application
+     * we are willing to keep using the stream. */
+    circ->base_.timestamp_dirty = approx_time();
+  }
 
   pathbias_count_use_attempt(circ);