From 8c85eef9b065573da2be12c631e906dc149b1a4f Mon Sep 17 00:00:00 2001 From: Roger Dingledine Date: Wed, 11 Jun 2008 01:14:23 +0000 Subject: start sending "bootstrap problem" status events when we're having troubles reaching relays. svn:r15116 --- src/or/connection_edge.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/or/connection_edge.c') 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); -- cgit v1.2.3-54-g00ecf