tor

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

commit 5338394316a6e7e292a27cae61ae602257054efc
parent 2178d68de1904f07bf0417e9309fcb0a54960556
Author: David Goulet <dgoulet@torproject.org>
Date:   Thu, 13 Nov 2025 11:09:22 -0500

circ: Set end reason to connection before closing it

Edge connections require an end reason else we trigger a log warning.

Signed-off-by: David Goulet <dgoulet@torproject.org>

Diffstat:
Msrc/core/or/circuitlist.c | 6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/core/or/circuitlist.c b/src/core/or/circuitlist.c @@ -2712,8 +2712,12 @@ circuits_handle_oom(size_t current_allocation) * outbuf due to a malicious destination holding off the read on us. */ if ((conn->type == CONN_TYPE_DIR && conn->linked_conn == NULL) || CONN_IS_EDGE(conn)) { - if (!conn->marked_for_close) + if (!conn->marked_for_close) { + if (CONN_IS_EDGE(conn)) { + TO_EDGE_CONN(conn)->end_reason = END_STREAM_REASON_RESOURCELIMIT; + } connection_mark_for_close(conn); + } mem_recovered += single_conn_free_bytes(conn); if (conn->type == CONN_TYPE_DIR) {