aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
Diffstat (limited to 'src/or')
-rw-r--r--src/or/circuitlist.c18
-rw-r--r--src/or/circuituse.c2
2 files changed, 14 insertions, 6 deletions
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
index 9dbec897c9..6d183fb9b1 100644
--- a/src/or/circuitlist.c
+++ b/src/or/circuitlist.c
@@ -1208,13 +1208,21 @@ assert_circuit_ok(const circuit_t *c)
if (c->n_conn) {
tor_assert(!c->n_hop);
- if (c->n_circ_id)
- tor_assert(c == circuit_get_by_circid_orconn(c->n_circ_id, c->n_conn));
+ if (c->n_circ_id) {
+ /* We use the _impl variant here to make sure we don't fail on marked
+ * circuits, which would not be returned by the regular function. */
+ circuit_t *c2 = circuit_get_by_circid_orconn_impl(c->n_circ_id,
+ c->n_conn);
+ tor_assert(c == c2);
+ }
}
if (or_circ && or_circ->p_conn) {
- if (or_circ->p_circ_id)
- tor_assert(c == circuit_get_by_circid_orconn(or_circ->p_circ_id,
- or_circ->p_conn));
+ if (or_circ->p_circ_id) {
+ /* ibid */
+ circuit_t *c2 = circuit_get_by_circid_orconn_impl(or_circ->p_circ_id,
+ or_circ->p_conn);
+ tor_assert(c == c2);
+ }
}
#if 0 /* false now that rendezvous exits are attached to p_streams */
if (origin_circ)
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index 8f4788064d..14acbf5e6c 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -1495,7 +1495,7 @@ connection_ap_handshake_attach_circuit(edge_connection_t *conn)
/* abort parallel intro circs, if any */
for (c = global_circuitlist; c; c = c->next) {
if (c->purpose == CIRCUIT_PURPOSE_C_INTRODUCING &&
- CIRCUIT_IS_ORIGIN(c)) {
+ !c->marked_for_close && CIRCUIT_IS_ORIGIN(c)) {
origin_circuit_t *oc = TO_ORIGIN_CIRCUIT(c);
if (oc->rend_data &&
!rend_cmp_service_ids(conn->rend_data->onion_address,