aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorAndrea Shepard <andrea@torproject.org>2012-10-01 14:22:04 -0700
committerAndrea Shepard <andrea@torproject.org>2012-10-10 00:44:46 -0700
commitc097fb33fc081165a55f0b9417d7c8bf5dc91cd6 (patch)
tree3584df86f4b078b1e18d314a18c2a347e5e136a7 /src/or
parent3d092ffbdd023a2be0307cb8a52bd48e2c85b257 (diff)
downloadtor-c097fb33fc081165a55f0b9417d7c8bf5dc91cd6.tar
tor-c097fb33fc081165a55f0b9417d7c8bf5dc91cd6.tar.gz
Detach circuits from circuitmux early when freeing channel so they can find the channel by ID
Diffstat (limited to 'src/or')
-rw-r--r--src/or/channel.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/or/channel.c b/src/or/channel.c
index 8241556b5..4ad5bf15f 100644
--- a/src/or/channel.c
+++ b/src/or/channel.c
@@ -2766,6 +2766,10 @@ channel_free_list(smartlist_t *channels, int mark_for_close)
"in state %s (%d)",
curr, U64_PRINTF_ARG(curr->global_identifier),
channel_state_to_string(curr->state), curr->state);
+ /* Detach circuits early so they can find the channel */
+ if (curr->cmux) {
+ circuitmux_detach_all_circuits(curr->cmux);
+ }
channel_unregister(curr);
if (mark_for_close) {
if (!(curr->state == CHANNEL_STATE_CLOSING ||