tor

The Tor anonymity network
git clone https://git.dasho.dev/tor.git
Log | Files | Refs | README | LICENSE

commit 45edc59caa435d2bcd444ebeb40fc822d5629978
parent 8a7ade95b64407fe29350f96def8782d049f4ddd
Author: David Goulet <dgoulet@torproject.org>
Date:   Wed, 10 Sep 2025 15:01:35 +0000

Merge branch 'cleanup' into 'main'

remove dead code from circuit_n_chan_done

See merge request tpo/core/tor!923
Diffstat:
Msrc/core/or/channel.c | 5++---
Msrc/core/or/circuitbuild.c | 13++-----------
Msrc/core/or/circuitbuild.h | 3+--
3 files changed, 5 insertions(+), 16 deletions(-)

diff --git a/src/core/or/channel.c b/src/core/or/channel.c @@ -1285,7 +1285,7 @@ channel_closed(channel_t *chan) /* Inform any pending (not attached) circs that they should * give up. */ if (! chan->has_been_open) - circuit_n_chan_done(chan, 0, 0); + circuit_n_chan_done(chan, 0); /* Now close all the attached circuits on it. */ circuit_unlink_all_from_channel(chan, END_CIRC_REASON_CHANNEL_CLOSED); @@ -1865,7 +1865,6 @@ channel_do_open_actions(channel_t *chan) { tor_addr_t remote_addr; int started_here; - int close_origin_circuits = 0; tor_assert(chan); @@ -1918,7 +1917,7 @@ channel_do_open_actions(channel_t *chan) } } - circuit_n_chan_done(chan, 1, close_origin_circuits); + circuit_n_chan_done(chan, 1); } /** diff --git a/src/core/or/circuitbuild.c b/src/core/or/circuitbuild.c @@ -659,17 +659,13 @@ circuit_handle_first_hop(origin_circuit_t *circ) return 0; } -/** Find any circuits that are waiting on <b>or_conn</b> to become +/** Find any circuits that are waiting on <b>chan</b> to become * open and get them to send their create cells forward. * * Status is 1 if connect succeeded, or 0 if connect failed. - * - * Close_origin_circuits is 1 if we should close all the origin circuits - * through this channel, or 0 otherwise. (This happens when we want to retry - * an older guard.) */ void -circuit_n_chan_done(channel_t *chan, int status, int close_origin_circuits) +circuit_n_chan_done(channel_t *chan, int status) { smartlist_t *pending_circs; int err_reason = 0; @@ -722,11 +718,6 @@ circuit_n_chan_done(channel_t *chan, int status, int close_origin_circuits) continue; } - if (close_origin_circuits && CIRCUIT_IS_ORIGIN(circ)) { - log_info(LD_CIRC,"Channel deprecated for origin circs; closing circ."); - circuit_mark_for_close(circ, END_CIRC_REASON_CHANNEL_CLOSED); - continue; - } log_debug(LD_CIRC, "Found circ, sending create cell."); /* circuit_deliver_create_cell will set n_circ_id and add us to * chan_circuid_circuit_map, so we don't need to call diff --git a/src/core/or/circuitbuild.h b/src/core/or/circuitbuild.h @@ -33,8 +33,7 @@ MOCK_DECL(origin_circuit_t *, circuit_establish_circuit_conflux, ( struct circuit_guard_state_t *origin_circuit_get_guard_state( origin_circuit_t *circ); int circuit_handle_first_hop(origin_circuit_t *circ); -void circuit_n_chan_done(channel_t *chan, int status, - int close_origin_circuits); +void circuit_n_chan_done(channel_t *chan, int status); int circuit_timeout_want_to_count_circ(const origin_circuit_t *circ); int circuit_send_next_onion_skin(origin_circuit_t *circ); void circuit_note_clock_jumped(int64_t seconds_elapsed, bool was_idle);