diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-04-18 13:04:37 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-04-18 13:04:37 -0400 |
commit | 47a0c10728712cbfa3683f218b9379299b968636 (patch) | |
tree | 11c95a36baa81647c024fed840da69096860ba62 /src/or/circuitlist.c | |
parent | bd169aa9a512857fe95fa0cbe44e4e6dbc2c800f (diff) | |
download | tor-47a0c10728712cbfa3683f218b9379299b968636.tar.gz tor-47a0c10728712cbfa3683f218b9379299b968636.zip |
Diagnostic warning to see if it's pending destroys causing 11553
Diffstat (limited to 'src/or/circuitlist.c')
-rw-r--r-- | src/or/circuitlist.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c index b71dc3c13a..8a8fc8b4ed 100644 --- a/src/or/circuitlist.c +++ b/src/or/circuitlist.c @@ -1065,13 +1065,21 @@ circuit_get_by_circid_channel_even_if_marked(circid_t circ_id, } /** Return true iff the circuit ID <b>circ_id</b> is currently used by a - * circuit, marked or not, on <b>chan</b>. */ + * circuit, marked or not, on <b>chan</b>, or if the circ ID is reserved until + * a queued destroy cell can be sent. + * + * (Return 1 if the circuit is present, marked or not; Return 2 + * if the circuit ID is pending a destroy.) + **/ int circuit_id_in_use_on_channel(circid_t circ_id, channel_t *chan) { int found = 0; - return circuit_get_by_circid_channel_impl(circ_id, chan, &found) != NULL - || found; + if (circuit_get_by_circid_channel_impl(circ_id, chan, &found) != NULL) + return 1; + if (found) + return 2; + return 0; } /** Return the circuit that a given edge connection is using. */ |