aboutsummaryrefslogtreecommitdiff
path: root/src/or/circuitlist.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-07-23 12:55:55 +0000
committerNick Mathewson <nickm@torproject.org>2008-07-23 12:55:55 +0000
commit087094961b0ba75435fe5bdfab0788b0e3b5293c (patch)
tree59e0bfe483f988021b0e5c222740d7b67ea5e09d /src/or/circuitlist.c
parent29795999a0ea917d2f3438b1e8c6debe7b04df80 (diff)
downloadtor-087094961b0ba75435fe5bdfab0788b0e3b5293c.tar.gz
tor-087094961b0ba75435fe5bdfab0788b0e3b5293c.zip
r17302@aud-055: nickm | 2008-07-23 14:55:28 +0200
Never allow a circuit to be created with the same circid as a circuit that has been marked for close. May be a fix for bug 779. Needs testing. Backport candidate. svn:r16136
Diffstat (limited to 'src/or/circuitlist.c')
-rw-r--r--src/or/circuitlist.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
index 7bd3829f62..adb0d7867e 100644
--- a/src/or/circuitlist.c
+++ b/src/or/circuitlist.c
@@ -661,6 +661,14 @@ circuit_get_by_circid_orconn(uint16_t circ_id, or_connection_t *conn)
return circ;
}
+/** Return true iff the circuit ID <b>circ_id</b> is currently used by a
+ * circuit, marked or not, on <b>conn</b>. */
+int
+circuit_id_in_use_on_orconn(uint16_t circ_id, or_connection_t *conn)
+{
+ return circuit_get_by_circid_orconn_impl(circ_id, conn) != NULL;
+}
+
/** Return the circuit that a given edge connection is using. */
circuit_t *
circuit_get_by_edge_conn(edge_connection_t *conn)