]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
remove dead code from circuit_n_chan_done
authordzwdz <not@dzwdz.net>
Mon, 8 Sep 2025 03:01:20 +0000 (05:01 +0200)
committerdzwdz <not@dzwdz.net>
Mon, 8 Sep 2025 03:01:20 +0000 (05:01 +0200)
close_origin_circuits was added in ccabbe702a072cfc4b2ec194d8211d06ce991904,
and the last usage was removed in 5a174ebfac759081c1c6c2adf614c43cc75325c3,
8 years ago.

src/core/or/channel.c
src/core/or/circuitbuild.c
src/core/or/circuitbuild.h

index b5b3f4c4f0ddd12f634dc492a1af47f5f59b7777..c45d5ce5665bacfca4e2ae7ba4ba3dbfde6de964 100644 (file)
@@ -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);
 }
 
 /**
index ebabb806c7231e02eb14573cf9e6210c982c7b1b..4fabe3a9f996f3eab329a7a15769b3630ad2c181 100644 (file)
@@ -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
index 60d718bd16ac32898b62f9a78d107fd1e5c68130..39446415867e432d5579c3bfcdfb4cf5bc3d85e9 100644 (file)
@@ -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);