[or-cvs] Don"t yell loudly about failed internal/bridge connections....

arma at seul.org arma at seul.org
Sun Apr 9 21:36:39 UTC 2006


Update of /home2/or/cvsroot/tor/src/or
In directory moria:/home/arma/work/onion/cvs/tor/src/or

Modified Files:
	circuituse.c connection_edge.c 
Log Message:
Don't yell loudly about failed internal/bridge connections. These
are reachability testing and rendserv upload/downloads, and they
have their own failure messages elsewhere.


Index: circuituse.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/circuituse.c,v
retrieving revision 1.123
retrieving revision 1.124
diff -u -p -d -r1.123 -r1.124
--- circuituse.c	27 Mar 2006 02:25:34 -0000	1.123
+++ circuituse.c	9 Apr 2006 21:36:37 -0000	1.124
@@ -1136,6 +1136,7 @@ connection_ap_handshake_attach_circuit(c
 {
   int retval;
   int conn_age;
+  int severity;
 
   tor_assert(conn);
   tor_assert(conn->type == CONN_TYPE_AP);
@@ -1143,11 +1144,12 @@ connection_ap_handshake_attach_circuit(c
   tor_assert(conn->socks_request);
 
   conn_age = time(NULL) - conn->timestamp_created;
+  severity = (!conn->addr && !conn->port) ? LOG_INFO : LOG_NOTICE;
   if (conn_age > get_options()->SocksTimeout) {
-    log_notice(LD_APP,
-               "Tried for %d seconds to get a connection to %s:%d. Giving up.",
-               conn_age, safe_str(conn->socks_request->address),
-               conn->socks_request->port);
+    log_fn(severity, LD_APP,
+           "Tried for %d seconds to get a connection to %s:%d. Giving up.",
+           conn_age, safe_str(conn->socks_request->address),
+           conn->socks_request->port);
     return -1;
   }
 

Index: connection_edge.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/connection_edge.c,v
retrieving revision 1.392
retrieving revision 1.393
diff -u -p -d -r1.392 -r1.393
--- connection_edge.c	27 Mar 2006 02:25:34 -0000	1.392
+++ connection_edge.c	9 Apr 2006 21:36:37 -0000	1.393
@@ -326,6 +326,7 @@ connection_ap_expire_beginning(void)
   int n, i;
   time_t now = time(NULL);
   or_options_t *options = get_options();
+  int severity;
 
   get_connection_array(&carray, &n);
 
@@ -333,9 +334,11 @@ connection_ap_expire_beginning(void)
     conn = carray[i];
     if (conn->type != CONN_TYPE_AP)
       continue;
+    /* if it's an internal bridge connection, don't yell its status. */
+    severity = (!conn->addr && !conn->port) ? LOG_INFO : LOG_NOTICE;
     if (conn->state == AP_CONN_STATE_CONTROLLER_WAIT) {
       if (now - conn->timestamp_lastread >= options->SocksTimeout) {
-        log_notice(LD_APP, "Closing unattached stream.");
+        log_fn(severity, LD_APP, "Closing unattached stream.");
         connection_mark_unattached_ap(conn, END_STREAM_REASON_TIMEOUT);
       }
       continue;
@@ -355,11 +358,11 @@ connection_ap_expire_beginning(void)
     }
     if (circ->purpose == CIRCUIT_PURPOSE_C_REND_JOINED) {
       if (now - conn->timestamp_lastread > options->SocksTimeout) {
-        log_notice(LD_REND,
-                   "Rend stream is %d seconds late. Giving up on address"
-                   " '%s.onion'.",
-                   (int)(now - conn->timestamp_lastread),
-                   safe_str(conn->socks_request->address));
+        log_fn(severity, LD_REND,
+               "Rend stream is %d seconds late. Giving up on address"
+               " '%s.onion'.",
+               (int)(now - conn->timestamp_lastread),
+               safe_str(conn->socks_request->address));
         connection_edge_end(conn, END_STREAM_REASON_TIMEOUT,
                             conn->cpath_layer);
         connection_mark_unattached_ap(conn, END_STREAM_REASON_TIMEOUT);
@@ -368,12 +371,12 @@ connection_ap_expire_beginning(void)
     }
     tor_assert(circ->purpose == CIRCUIT_PURPOSE_C_GENERAL);
     nickname = build_state_get_exit_nickname(circ->build_state);
-    log_notice(LD_APP,
-               "We tried for %d seconds to connect to '%s' using exit '%s'."
-               " Retrying on a new circuit.",
-               (int)(now - conn->timestamp_lastread),
-               safe_str(conn->socks_request->address),
-               nickname ? nickname : "*unnamed*");
+    log_fn(severity, LD_APP,
+           "We tried for %d seconds to connect to '%s' using exit '%s'."
+           " Retrying on a new circuit.",
+           (int)(now - conn->timestamp_lastread),
+           safe_str(conn->socks_request->address),
+           nickname ? nickname : "*unnamed*");
     /* send an end down the circuit */
     connection_edge_end(conn, END_STREAM_REASON_TIMEOUT, conn->cpath_layer);
     /* un-mark it as ending, since we're going to reuse it */



More information about the tor-commits mailing list