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_or.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_or.c')
-rw-r--r-- | src/or/connection_or.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/or/connection_or.c b/src/or/connection_or.c index 5a15bddbca..1081a46437 100644 --- a/src/or/connection_or.c +++ b/src/or/connection_or.c @@ -513,6 +513,7 @@ connection_or_connect(uint32_t addr, uint16_t port, const char *id_digest) { or_connection_t *conn; or_options_t *options = get_options(); + int socket_error = 0; tor_assert(id_digest); @@ -534,7 +535,8 @@ connection_or_connect(uint32_t addr, uint16_t port, const char *id_digest) port = options->HttpsProxyPort; } - switch (connection_connect(TO_CONN(conn), conn->_base.address, addr, port)) { + switch (connection_connect(TO_CONN(conn), conn->_base.address, + addr, port, &socket_error)) { case -1: /* If the connection failed immediately, and we're using * an https proxy, our https proxy is down. Don't blame the @@ -545,9 +547,9 @@ connection_or_connect(uint32_t addr, uint16_t port, const char *id_digest) router_set_status(conn->identity_digest, 0); } control_event_or_conn_status(conn, OR_CONN_EVENT_FAILED, - END_OR_CONN_REASON_TCP_REFUSED); - /* XXX connection_connect() can fail for all sorts of other reasons */ - control_event_bootstrap_problem("foo", END_OR_CONN_REASON_TCP_REFUSED); + errno_to_orconn_end_reason(socket_error)); + control_event_bootstrap_problem(tor_socket_strerror(socket_error), + errno_to_orconn_end_reason(socket_error)); connection_free(TO_CONN(conn)); return NULL; case 0: |