aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-07-20 20:27:36 -0400
committerNick Mathewson <nickm@torproject.org>2011-07-20 20:27:36 -0400
commit2c98104c7410e859e68a8e9e7b82f9af7595c921 (patch)
treee7db7d55c068c7dc0d61cbdd1c53d8f9cc21bd1a
parent5df99cec98c809e919aaca6054cb8b59ff151e41 (diff)
downloadtor-2c98104c7410e859e68a8e9e7b82f9af7595c921.tar
tor-2c98104c7410e859e68a8e9e7b82f9af7595c921.tar.gz
Add another precondition for isolation-clearing; fix 3620
-rw-r--r--src/or/circuituse.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index acfdc237e..c48020115 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -1041,8 +1041,15 @@ circuit_has_opened(origin_circuit_t *circ)
* controller did it. Just let it slide. */
}
- if (can_try_clearing_isolation && !tried_clearing_isolation &&
+ if (/* The circuit may have become non-open if it was cannibalized.*/
+ circ->_base.state == CIRCUIT_STATE_OPEN &&
+ /* Only if the purpose is clearable, and only if we haven't tried
+ * to clear isolation yet, do we try. */
+ can_try_clearing_isolation && !tried_clearing_isolation &&
+ /* If !isolation_values_set, there is nothing to clear. */
circ->isolation_values_set &&
+ /* It's not legal to clear a circuit's isolation info if it's ever had
+ * streams attached */
!circ->isolation_any_streams_attached) {
/* If we have any isolation information set on this circuit, and
* we didn't manage to attach any streams to it, then we can