Ticket #15482: bug15482.patch

File bug15482.patch, 1.4 KB (added by mikeperry, 4 years ago)

Simpler version of Nick's patch for TBB 4.5a5 (no randomness or max).

  • src/or/circuituse.c

    From 748414784f71126b093aa7466908e00f71a7b046 Mon Sep 17 00:00:00 2001
    From: Mike Perry <mikeperry-git@torproject.org>
    Date: Fri, 27 Mar 2015 12:57:37 -0700
    Subject: [PATCH] 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.
    ---
     src/or/circuituse.c | 11 +++++++++--
     1 file changed, 9 insertions(+), 2 deletions(-)
    
    diff --git a/src/or/circuituse.c b/src/or/circuituse.c
    index d0d31ad..6cce4bf 100644
    a b connection_ap_handshake_attach_chosen_circuit(entry_connection_t *conn, 
    22642264
    22652265  base_conn->state = AP_CONN_STATE_CIRCUIT_WAIT;
    22662266
    2267   if (!circ->base_.timestamp_dirty)
    2268     circ->base_.timestamp_dirty = time(NULL);
     2267  if (!circ->base_.timestamp_dirty) {
     2268    circ->base_.timestamp_dirty = approx_time();
     2269  } else if ((conn->entry_cfg.isolation_flags & ISO_SOCKSAUTH) &&
     2270             (conn->socks_request->usernamelen ||
     2271              conn->socks_request->passwordlen)) {
     2272    /* When stream isolation is in use and controlled by an application
     2273     * we are willing to keep using the stream. */
     2274    circ->base_.timestamp_dirty = approx_time();
     2275  }
    22692276
    22702277  pathbias_count_use_attempt(circ);
    22712278