[tor-commits] [tor/master] Avoid a double-mark in connection_or_close_connection_cb
nickm at torproject.org
nickm at torproject.org
Fri Nov 25 22:22:51 UTC 2011
commit 633071eb3bcf2c4106e93de28d727594bd23b1db
Author: Nick Mathewson <nickm at torproject.org>
Date: Fri Nov 25 17:21:11 2011 -0500
Avoid a double-mark in connection_or_close_connection_cb
---
src/or/connection_or.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/or/connection_or.c b/src/or/connection_or.c
index cbdfa44..e868b7b 100644
--- a/src/or/connection_or.c
+++ b/src/or/connection_or.c
@@ -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
More information about the tor-commits
mailing list