summaryrefslogtreecommitdiff
path: root/src/or/circuituse.c
diff options
context:
space:
mode:
authorMike Perry <mikeperry-git@torproject.org>2015-03-27 12:57:37 -0700
committerYawning Angel <yawning@schwanenlied.me>2015-09-01 15:21:47 +0000
commita16115d9cb8c2e88da8a59c212155e2fd0e16aa3 (patch)
tree486743515bb67febf1557740c189dba899d7ff4e /src/or/circuituse.c
parent0e60c52c6cf1863866a37dcb694823b21898eaf3 (diff)
downloadtor-a16115d9cb8c2e88da8a59c212155e2fd0e16aa3.tar.gz
tor-a16115d9cb8c2e88da8a59c212155e2fd0e16aa3.zip
Bug 15482: Don't abandon circuits that are still in use for browsing.
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.
Diffstat (limited to 'src/or/circuituse.c')
-rw-r--r--src/or/circuituse.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index a3b71974ca..e10bb82641 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -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);