]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix socket accounting with ORConn sockets.
authorNick Mathewson <nickm@torproject.org>
Thu, 20 Sep 2018 16:52:29 +0000 (12:52 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 20 Sep 2018 16:52:29 +0000 (12:52 -0400)
When we close a socket via tor_tls_free(), we previously had no way
for our socket accounting logic to learn about it.  This meant that
the socket accounting code would think we had run out of sockets,
and freak out.

Fixes bug 27795; bugfix on 0.3.5.1-alpha.

changes/bug27795 [new file with mode: 0644]
src/core/mainloop/connection.c

diff --git a/changes/bug27795 b/changes/bug27795
new file mode 100644 (file)
index 0000000..43bb1ba
--- /dev/null
@@ -0,0 +1,5 @@
+  o Major bugfixes (socket accounting):
+    - In our socket accounting code, count a socket as closed even
+      when it is closed indirectly by the TLS layer. Previously, we
+      would count these sockets as still in use, and incorrectly believe that
+      we had run out of sockets. Fixes bug 27795; bugfix on 0.3.5.1-alpha.
index 0c3abc8442ffba4b5d29430f5e0299bd536ba5fa..b0cb5322c3cfc5a6bace12c5906c82f398e91f56 100644 (file)
@@ -646,6 +646,7 @@ connection_free_minimal(connection_t *conn)
       } else {
         /* The tor_tls_free() call below will close the socket; we must tell
          * the code below not to close it a second time. */
+        tor_release_socket_ownership(conn->s);
         conn->s = TOR_INVALID_SOCKET;
       }
       tor_tls_free(or_conn->tls);