[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r9552: more useful log messages when we give up on a stream (tor/trunk/src/or)



Author: arma
Date: 2007-02-10 21:15:42 -0500 (Sat, 10 Feb 2007)
New Revision: 9552

Modified:
   tor/trunk/src/or/connection.c
   tor/trunk/src/or/connection_edge.c
Log:
more useful log messages when we give up on a stream


Modified: tor/trunk/src/or/connection.c
===================================================================
--- tor/trunk/src/or/connection.c	2007-02-10 21:38:31 UTC (rev 9551)
+++ tor/trunk/src/or/connection.c	2007-02-11 02:15:42 UTC (rev 9552)
@@ -99,13 +99,13 @@
       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;

Modified: tor/trunk/src/or/connection_edge.c
===================================================================
--- tor/trunk/src/or/connection_edge.c	2007-02-10 21:38:31 UTC (rev 9551)
+++ tor/trunk/src/or/connection_edge.c	2007-02-11 02:15:42 UTC (rev 9552)
@@ -372,28 +372,25 @@
 
     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);
       }