aboutsummaryrefslogtreecommitdiff
path: root/src/core/or/circuitbuild.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/or/circuitbuild.c')
-rw-r--r--src/core/or/circuitbuild.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/or/circuitbuild.c b/src/core/or/circuitbuild.c
index 3df0f9be8f..a3a7a8cf58 100644
--- a/src/core/or/circuitbuild.c
+++ b/src/core/or/circuitbuild.c
@@ -574,6 +574,7 @@ circuit_handle_first_hop(origin_circuit_t *circ)
&firsthop->extend_info->ed_identity,
orport4 ? &orport4->addr : NULL,
orport6 ? &orport6->addr : NULL,
+ true,
&msg,
&should_launch);
@@ -590,6 +591,11 @@ circuit_handle_first_hop(origin_circuit_t *circ)
log_info(LD_CIRC,"connect to firsthop failed. Closing.");
return -END_CIRC_REASON_CONNECTFAILED;
}
+ /* We didn't find a channel, but we're launching one for an origin
+ * circuit. (If we decided not to launch a channel, then we found at
+ * least one once good in-progress channel use for this circuit, and
+ * marked it in channel_get_for_extend().) */
+ channel_mark_as_used_for_origin_circuit(n_chan);
circuit_chan_publish(circ, n_chan);
}
@@ -602,6 +608,8 @@ circuit_handle_first_hop(origin_circuit_t *circ)
} else { /* it's already open. use it. */
tor_assert(!circ->base_.n_hop);
circ->base_.n_chan = n_chan;
+ /* We found a channel, and we're using it for an origin circuit. */
+ channel_mark_as_used_for_origin_circuit(n_chan);
circuit_chan_publish(circ, n_chan);
log_debug(LD_CIRC,"Conn open for %s. Delivering first onion skin.",
safe_str_client(extend_info_describe(firsthop->extend_info)));