diff options
author | Nick Mathewson <nickm@torproject.org> | 2013-09-09 13:48:44 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-03-14 11:57:51 -0400 |
commit | 1a74360c2dd5c197e2dfc28b37961c77bb7792f1 (patch) | |
tree | d1e856ff67b9dcf2a97fabaaea5fc599566a62d6 /src/or/relay.c | |
parent | 102bb1c04f5cb4fb3eae7f41f80660e47c64ceb6 (diff) | |
download | tor-1a74360c2dd5c197e2dfc28b37961c77bb7792f1.tar.gz tor-1a74360c2dd5c197e2dfc28b37961c77bb7792f1.zip |
Test code for implementation of faster circuit_unlink_all_from_channel
This contains the obvious implementation using the circuitmux data
structure. It also runs the old (slow) algorithm and compares
the results of the two to make sure that they're the same.
Needs review and testing.
Diffstat (limited to 'src/or/relay.c')
-rw-r--r-- | src/or/relay.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/or/relay.c b/src/or/relay.c index d6742d25e1..8c009b5564 100644 --- a/src/or/relay.c +++ b/src/or/relay.c @@ -2271,14 +2271,18 @@ update_circuit_on_cmux_(circuit_t *circ, cell_direction_t direction, assert_cmux_ok_paranoid(chan); } -/** Remove all circuits from the cmux on <b>chan</b>. */ +/** Remove all circuits from the cmux on <b>chan</b>. + * + * If <b>circuits_out</b> is non-NULL, add all detached circuits to + * <b>circuits_out</b>. + **/ void -channel_unlink_all_circuits(channel_t *chan) +channel_unlink_all_circuits(channel_t *chan, smartlist_t *circuits_out) { tor_assert(chan); tor_assert(chan->cmux); - circuitmux_detach_all_circuits(chan->cmux); + circuitmux_detach_all_circuits(chan->cmux, circuits_out); chan->num_n_circuits = 0; chan->num_p_circuits = 0; } |