diff options
author | Roger Dingledine <arma@torproject.org> | 2008-06-11 01:14:23 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2008-06-11 01:14:23 +0000 |
commit | 8c85eef9b065573da2be12c631e906dc149b1a4f (patch) | |
tree | 7d2fbc51f23e83911e03ba5e83932c68ec095851 /src/or/connection_edge.c | |
parent | 42f21007a34ed5f0474e7eccd0991f1d8c5423f0 (diff) | |
download | tor-8c85eef9b065573da2be12c631e906dc149b1a4f.tar.gz tor-8c85eef9b065573da2be12c631e906dc149b1a4f.zip |
start sending "bootstrap problem" status events when we're having troubles
reaching relays.
svn:r15116
Diffstat (limited to 'src/or/connection_edge.c')
-rw-r--r-- | src/or/connection_edge.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c index 84f80eb18d..964824c15e 100644 --- a/src/or/connection_edge.c +++ b/src/or/connection_edge.c @@ -236,7 +236,7 @@ connection_edge_end_errno(edge_connection_t *conn) { uint8_t reason; tor_assert(conn); - reason = (uint8_t)errno_to_stream_end_reason(tor_socket_errno(conn->_base.s)); + reason = errno_to_stream_end_reason(tor_socket_errno(conn->_base.s)); return connection_edge_end(conn, reason); } @@ -2609,6 +2609,7 @@ connection_exit_connect(edge_connection_t *edge_conn) uint32_t addr; uint16_t port; connection_t *conn = TO_CONN(edge_conn); + int socket_error = 0; if (!connection_edge_is_rendezvous_stream(edge_conn) && router_compare_to_my_exit_policy(edge_conn)) { @@ -2644,8 +2645,10 @@ connection_exit_connect(edge_connection_t *edge_conn) } log_debug(LD_EXIT,"about to try connecting"); - switch (connection_connect(conn, conn->address, addr, port)) { + switch (connection_connect(conn, conn->address, addr, port, &socket_error)) { case -1: + /* XXX021 use socket_error below rather than trying to piece things + * together from the current errno, which may have been clobbered. */ connection_edge_end_errno(edge_conn); circuit_detach_stream(circuit_get_by_edge_conn(edge_conn), edge_conn); connection_free(conn); |