]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Avoid a double-mark in connection_or_close_connection_cb
authorNick Mathewson <nickm@torproject.org>
Fri, 25 Nov 2011 22:21:11 +0000 (17:21 -0500)
committerNick Mathewson <nickm@torproject.org>
Fri, 25 Nov 2011 22:21:11 +0000 (17:21 -0500)
src/or/connection_or.c

index cbdfa445816a9c8dd904a5f317065c3a6764915f..e868b7b78d4671dedc5f6f553cd90507ceb507ff 100644 (file)
@@ -1159,10 +1159,12 @@ connection_or_tls_renegotiated_cb(tor_tls_t *tls, void *_conn)
 static void
 connection_or_close_connection_cb(void *_conn)
 {
-  or_connection_t *conn = _conn;
+  or_connection_t *or_conn = _conn;
+  connection_t *conn = TO_CONN(or_conn);
 
-  connection_stop_reading(TO_CONN(conn));
-  connection_mark_for_close(TO_CONN(conn));
+  connection_stop_reading(conn);
+  if (!conn->marked_for_close)
+    connection_mark_for_close(conn);
 }
 
 /** Move forward with the tls handshake. If it finishes, hand