]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
conn: Notify btrack subsys on normal OR conn close
authorDavid Goulet <dgoulet@torproject.org>
Mon, 1 Aug 2022 14:58:40 +0000 (10:58 -0400)
committerDavid Goulet <dgoulet@torproject.org>
Mon, 1 Aug 2022 14:58:40 +0000 (10:58 -0400)
Fixes #40604

Signed-off-by: David Goulet <dgoulet@torproject.org>
changes/ticket40604 [new file with mode: 0644]
src/core/or/connection_or.c

diff --git a/changes/ticket40604 b/changes/ticket40604
new file mode 100644 (file)
index 0000000..ec24a46
--- /dev/null
@@ -0,0 +1,5 @@
+  o Major bugfixes (relay):
+    - Remove OR connections btrack subsystem entries when the connections
+      closes normally. Before this, we would only close it on error and thus
+      leaking memory for each normal OR connections. Fixes bug 40604; bugfix
+      on 0.4.0.1-alpha.
index e3e81ed9cb3d9000d619753d3177d4e164e183f2..0cd3c058ecff2b3341d17928189d3c45728c978c 100644 (file)
@@ -799,6 +799,10 @@ connection_or_about_to_close(or_connection_t *or_conn)
   } else if (!tor_digest_is_zero(or_conn->identity_digest)) {
     connection_or_event_status(or_conn, OR_CONN_EVENT_CLOSED,
                 tls_error_to_orconn_end_reason(or_conn->tls_error));
+  } else {
+    /* Normal close, we notify of a done connection. */
+    connection_or_event_status(or_conn, OR_CONN_EVENT_CLOSED,
+                               END_OR_CONN_REASON_DONE);
   }
 }