[tor-commits] [tor/master] Ignore all bufferevent events on a marked connection

nickm at torproject.org nickm at torproject.org
Thu Dec 22 14:45:42 UTC 2011


commit e5e50d86ca4d4cf7ec3f78dbaa989fb4b6063f25
Author: Nick Mathewson <nickm at torproject.org>
Date:   Sat Dec 17 14:06:10 2011 -0500

    Ignore all bufferevent events on a marked connection
    
    Bug 4697; fix on 0.2.3.1-alpha
---
 changes/bug4697     |    5 +++++
 src/or/connection.c |    3 +++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/changes/bug4697 b/changes/bug4697
new file mode 100644
index 0000000..c3c940d
--- /dev/null
+++ b/changes/bug4697
@@ -0,0 +1,5 @@
+  o Minor bugfixes:
+    - Fix an assertion failure when, while running with bufferevents, a
+      connection finishes connecting after it is marked for close, but
+      before it is closed. Fix for bug 4697; Bugfix on 0.2.3.1-alpha.
+
diff --git a/src/or/connection.c b/src/or/connection.c
index 28d8bca..9283c98 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -2960,6 +2960,9 @@ connection_handle_event_cb(struct bufferevent *bufev, short event, void *arg)
 {
   connection_t *conn = arg;
   (void) bufev;
+  if (conn->marked_for_close)
+    return;
+
   if (event & BEV_EVENT_CONNECTED) {
     tor_assert(connection_state_is_connecting(conn));
     if (connection_finished_connecting(conn)<0)





More information about the tor-commits mailing list