diff options
author | Nick Mathewson <nickm@torproject.org> | 2008-03-17 03:37:54 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2008-03-17 03:37:54 +0000 |
commit | c59f66709d024dfb112d1f648b14aeec057e1308 (patch) | |
tree | ba181299380d544fb82b5bf00c1d535e56132864 /src/or/connection_edge.c | |
parent | bd547e3cfc5608cbab9c571a5d05d7de838dba77 (diff) | |
download | tor-c59f66709d024dfb112d1f648b14aeec057e1308.tar.gz tor-c59f66709d024dfb112d1f648b14aeec057e1308.zip |
r18862@catbus: nickm | 2008-03-16 23:33:11 -0400
Part of fix for bug 617: allow connection_ap_handshake_attach_circuit() to mark connections, to avoid double-mark warnings. Note that this is an incomplete refactoring.
svn:r14066
Diffstat (limited to 'src/or/connection_edge.c')
-rw-r--r-- | src/or/connection_edge.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c index 2cb8e5e807..549c20c78f 100644 --- a/src/or/connection_edge.c +++ b/src/or/connection_edge.c @@ -431,7 +431,8 @@ connection_ap_expire_beginning(void) /* move it back into 'pending' state, and try to attach. */ if (connection_ap_detach_retriable(conn, TO_ORIGIN_CIRCUIT(circ), END_STREAM_REASON_TIMEOUT)<0) { - connection_mark_unattached_ap(conn, END_STREAM_REASON_CANT_ATTACH); + if (!conn->_base.marked_for_close) + connection_mark_unattached_ap(conn, END_STREAM_REASON_CANT_ATTACH); } }); /* end foreach */ } @@ -452,7 +453,9 @@ connection_ap_attach_pending(void) continue; edge_conn = TO_EDGE_CONN(conn); if (connection_ap_handshake_attach_circuit(edge_conn) < 0) { - connection_mark_unattached_ap(edge_conn, END_STREAM_REASON_CANT_ATTACH); + if (!edge_conn->_base.marked_for_close) + connection_mark_unattached_ap(edge_conn, + END_STREAM_REASON_CANT_ATTACH); } }); } @@ -1501,7 +1504,8 @@ connection_ap_handshake_rewrite_and_attach(edge_connection_t *conn, conn, circ, cpath) < 0) || (!circ && connection_ap_handshake_attach_circuit(conn) < 0)) { - connection_mark_unattached_ap(conn, END_STREAM_REASON_CANT_ATTACH); + if (!conn->_base.marked_for_close) + connection_mark_unattached_ap(conn, END_STREAM_REASON_CANT_ATTACH); return -1; } return 0; @@ -1562,7 +1566,8 @@ connection_ap_handshake_rewrite_and_attach(edge_connection_t *conn, conn->_base.state = AP_CONN_STATE_CIRCUIT_WAIT; log_info(LD_REND, "Descriptor is here and fresh enough. Great."); if (connection_ap_handshake_attach_circuit(conn) < 0) { - connection_mark_unattached_ap(conn, END_STREAM_REASON_CANT_ATTACH); + if (!conn->_base.marked_for_close) + connection_mark_unattached_ap(conn, END_STREAM_REASON_CANT_ATTACH); return -1; } } else { @@ -2100,7 +2105,8 @@ connection_ap_make_link(char *address, uint16_t port, /* attaching to a dirty circuit is fine */ if (connection_ap_handshake_attach_circuit(conn) < 0) { - connection_mark_unattached_ap(conn, END_STREAM_REASON_CANT_ATTACH); + if (!conn->_base.marked_for_close) + connection_mark_unattached_ap(conn, END_STREAM_REASON_CANT_ATTACH); return NULL; } |