tor

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

commit 1d2a4ac27a90415e16fdd4f7053033b7d7bcebc9
parent 5b69536ee24cf23baf003ffcabe2483dd9c2a014
Author: Nick Mathewson <nickm@torproject.org>
Date:   Thu, 17 Apr 2025 19:37:15 -0400

Rename relay_msg_get_format to circuit_get_relay_format.

Diffstat:
Msrc/core/or/relay.c | 6+++---
Msrc/core/or/relay_msg.c | 3+--
Msrc/core/or/relay_msg.h | 4++--
3 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/core/or/relay.c b/src/core/or/relay.c @@ -259,7 +259,7 @@ circuit_receive_relay_cell(cell_t *cell, circuit_t *circ, if (recognized) { edge_connection_t *conn = NULL; - relay_cell_fmt_t format = relay_msg_get_format(circ, layer_hint); + relay_cell_fmt_t format = circuit_get_relay_format(circ, layer_hint); /* Recognized cell, the cell digest has been updated, we'll record it for * the SENDME if need be. */ @@ -621,7 +621,7 @@ relay_send_command_from_edge_,(streamid_t stream_id, circuit_t *orig_circ, size_t msg_body_len; { - relay_cell_fmt_t cell_format = relay_msg_get_format(circ, cpath_layer); + relay_cell_fmt_t cell_format = circuit_get_relay_format(circ, cpath_layer); relay_msg_t msg; if (payload_len > relay_cell_max_payload_size(cell_format, relay_command)) { @@ -2231,7 +2231,7 @@ connection_edge_get_inbuf_bytes_to_package(size_t n_available, (on_circuit->send_randomness_after_n_cells == 0) && (! on_circuit->have_sent_sufficiently_random_cell); - relay_cell_fmt_t cell_format = relay_msg_get_format(on_circuit, cpath); + relay_cell_fmt_t cell_format = circuit_get_relay_format(on_circuit, cpath); size_t target_length = relay_cell_max_payload_size(cell_format, RELAY_COMMAND_DATA); diff --git a/src/core/or/relay_msg.c b/src/core/or/relay_msg.c @@ -287,9 +287,8 @@ relay_msg_decode_cell(relay_cell_fmt_t format, /** Return the format to use. * * NULL can be passed but not for both. */ -/* TODO #41051: Rename this. */ relay_cell_fmt_t -relay_msg_get_format(const circuit_t *circ, const crypt_path_t *cpath) +circuit_get_relay_format(const circuit_t *circ, const crypt_path_t *cpath) { if (circ && CIRCUIT_IS_ORCIRC(circ)) { return CONST_TO_OR_CIRCUIT(circ)->relay_cell_format; diff --git a/src/core/or/relay_msg.h b/src/core/or/relay_msg.h @@ -32,8 +32,8 @@ relay_msg_t *relay_msg_decode_cell( FREE_AND_NULL(relay_msg_t, relay_msg_free_, (msg)) /* Getters */ -relay_cell_fmt_t relay_msg_get_format(const circuit_t *circ, - const crypt_path_t *cpath); +relay_cell_fmt_t circuit_get_relay_format(const circuit_t *circ, + const crypt_path_t *cpath); /* * NOTE: The following are inlined for performance reasons. These values are