diff options
author | Nick Mathewson <nickm@torproject.org> | 2013-03-18 16:36:25 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2013-03-18 16:36:25 -0400 |
commit | 597cd893c557f8e05be98b6cade1b312fc6f0f8d (patch) | |
tree | e0739825eef13b029be94b06ea742d38f888aad4 /src/or/connection_edge.c | |
parent | 01407f9718a7b1eb4e43b46c2799a390551aad29 (diff) | |
parent | 7bb51fdd89feb5ea3eb7e0a0b76c0dda0e50a82e (diff) | |
download | tor-597cd893c557f8e05be98b6cade1b312fc6f0f8d.tar.gz tor-597cd893c557f8e05be98b6cade1b312fc6f0f8d.zip |
Merge remote-tracking branch 'public/bug6174' into maint-0.2.4
Diffstat (limited to 'src/or/connection_edge.c')
-rw-r--r-- | src/or/connection_edge.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c index 0660b1fafd..9c39c25219 100644 --- a/src/or/connection_edge.c +++ b/src/or/connection_edge.c @@ -674,12 +674,10 @@ connection_ap_expire_beginning(void) /* un-mark it as ending, since we're going to reuse it */ conn->edge_has_sent_end = 0; conn->end_reason = 0; - /* kludge to make us not try this circuit again, yet to allow - * current streams on it to survive if they can: make it - * unattractive to use for new streams */ - /* XXXX024 this is a kludgy way to do this. */ - tor_assert(circ->timestamp_dirty); - circ->timestamp_dirty -= options->MaxCircuitDirtiness; + /* make us not try this circuit again, but allow + * current streams on it to survive if they can */ + mark_circuit_unusable_for_new_conns(TO_ORIGIN_CIRCUIT(circ)); + /* give our stream another 'cutoff' seconds to try */ conn->base_.timestamp_lastread += cutoff; if (entry_conn->num_socks_retries < 250) /* avoid overflow */ @@ -1806,9 +1804,7 @@ connection_ap_handshake_send_begin(entry_connection_t *ap_conn) connection_mark_unattached_ap(ap_conn, END_STREAM_REASON_INTERNAL); /* Mark this circuit "unusable for new streams". */ - /* XXXX024 this is a kludgy way to do this. */ - tor_assert(circ->base_.timestamp_dirty); - circ->base_.timestamp_dirty -= get_options()->MaxCircuitDirtiness; + mark_circuit_unusable_for_new_conns(circ); return -1; } @@ -1899,9 +1895,7 @@ connection_ap_handshake_send_resolve(entry_connection_t *ap_conn) connection_mark_unattached_ap(ap_conn, END_STREAM_REASON_INTERNAL); /* Mark this circuit "unusable for new streams". */ - /* XXXX024 this is a kludgy way to do this. */ - tor_assert(circ->base_.timestamp_dirty); - circ->base_.timestamp_dirty -= get_options()->MaxCircuitDirtiness; + mark_circuit_unusable_for_new_conns(circ); return -1; } |