]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
circ: Set end reason to connection before closing it
authorDavid Goulet <dgoulet@torproject.org>
Thu, 13 Nov 2025 16:09:22 +0000 (11:09 -0500)
committerDavid Goulet <dgoulet@torproject.org>
Thu, 13 Nov 2025 19:45:58 +0000 (14:45 -0500)
Edge connections require an end reason else we trigger a log warning.

Signed-off-by: David Goulet <dgoulet@torproject.org>
src/core/or/circuitlist.c

index 6b454cab27dea82d7102255dd0f01c3a709b3364..eb208cd5c517d8e1be79e5aa43ac83a212c020e1 100644 (file)
@@ -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) {