diff options
author | Roger Dingledine <arma@torproject.org> | 2007-02-11 02:15:42 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2007-02-11 02:15:42 +0000 |
commit | 731d37f7177aeab0859e40fc23d338588346dd91 (patch) | |
tree | 4a28b0b72164d6769d4fd667c5c8579a325c9fda /src | |
parent | a1c80551312e13258894b95f3254a6932fb99018 (diff) | |
download | tor-731d37f7177aeab0859e40fc23d338588346dd91.tar.gz tor-731d37f7177aeab0859e40fc23d338588346dd91.zip |
more useful log messages when we give up on a stream
svn:r9552
Diffstat (limited to 'src')
-rw-r--r-- | src/or/connection.c | 8 | ||||
-rw-r--r-- | src/or/connection_edge.c | 39 |
2 files changed, 22 insertions, 25 deletions
diff --git a/src/or/connection.c b/src/or/connection.c index 5edb5b6572..00622f86e9 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -99,13 +99,13 @@ conn_state_to_string(int type, int state) break; case CONN_TYPE_AP: switch (state) { - case AP_CONN_STATE_SOCKS_WAIT: return "waiting for dest info"; + case AP_CONN_STATE_SOCKS_WAIT: return "waiting for socks info"; case AP_CONN_STATE_NATD_WAIT: return "waiting for natd dest info"; case AP_CONN_STATE_RENDDESC_WAIT: return "waiting for rendezvous desc"; case AP_CONN_STATE_CONTROLLER_WAIT: return "waiting for controller"; - case AP_CONN_STATE_CIRCUIT_WAIT: return "waiting for safe circuit"; - case AP_CONN_STATE_CONNECT_WAIT: return "waiting for connect"; - case AP_CONN_STATE_RESOLVE_WAIT: return "waiting for resolve"; + case AP_CONN_STATE_CIRCUIT_WAIT: return "waiting for circuit"; + case AP_CONN_STATE_CONNECT_WAIT: return "waiting for connect response"; + case AP_CONN_STATE_RESOLVE_WAIT: return "waiting for resolve response"; case AP_CONN_STATE_OPEN: return "open"; } break; diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c index b40425c3f8..f35476167b 100644 --- a/src/or/connection_edge.c +++ b/src/or/connection_edge.c @@ -372,28 +372,25 @@ connection_ap_expire_beginning(void) if (AP_CONN_STATE_IS_UNATTACHED(conn->_base.state)) { if (seconds_idle >= options->SocksTimeout) { - if (conn->_base.state == AP_CONN_STATE_CIRCUIT_WAIT) { - log_fn(severity, LD_APP, - "Tried for %d seconds to get a connection to %s:%d. Giving up.", + log_fn(severity, LD_APP, + "Tried for %d seconds to get a connection to %s:%d. " + "Giving up. (%s)", seconds_idle, safe_str(conn->socks_request->address), - conn->socks_request->port); - } else { - log_fn(severity, LD_APP, "Closing unattached stream (state %d).", - conn->_base.state); - /* XXX012 remove the below clause before stable release -RD */ - if (conn->_base.state == AP_CONN_STATE_SOCKS_WAIT) { - /* extra debugging */ - log_fn(severity, LD_APP, - "Hints: is_reading %d, inbuf len %lu, socks: version %d, " - "command %d, has_finished %d, address %s, port %d.", - connection_is_reading(TO_CONN(conn)), - (unsigned long)buf_datalen(conn->_base.inbuf), - (int)conn->socks_request->socks_version, - conn->socks_request->command, - conn->socks_request->has_finished, - conn->socks_request->address, - (int)conn->socks_request->port); - } + conn->socks_request->port, + conn_state_to_string(CONN_TYPE_AP, conn->_base.state)); + /* XXX012 remove the below clause before stable release -RD */ + if (conn->_base.state == AP_CONN_STATE_SOCKS_WAIT) { + /* extra debugging */ + log_fn(severity, LD_APP, + "Hints: is_reading %d, inbuf len %lu, socks: version %d, " + "command %d, has_finished %d, address %s, port %d.", + connection_is_reading(TO_CONN(conn)), + (unsigned long)buf_datalen(conn->_base.inbuf), + (int)conn->socks_request->socks_version, + conn->socks_request->command, + conn->socks_request->has_finished, + conn->socks_request->address, + (int)conn->socks_request->port); } connection_mark_unattached_ap(conn, END_STREAM_REASON_TIMEOUT); } |