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

[or-cvs] r17991: {tor} actually find the right identity_digest to blame when we get (tor/trunk/src/or)



Author: arma
Date: 2009-01-06 19:30:12 -0500 (Tue, 06 Jan 2009)
New Revision: 17991

Modified:
   tor/trunk/src/or/circuituse.c
   tor/trunk/src/or/command.c
Log:
actually find the right identity_digest to blame when we get
a destroy cell from our first hop.


Modified: tor/trunk/src/or/circuituse.c
===================================================================
--- tor/trunk/src/or/circuituse.c	2009-01-06 23:40:51 UTC (rev 17990)
+++ tor/trunk/src/or/circuituse.c	2009-01-07 00:30:12 UTC (rev 17991)
@@ -800,12 +800,11 @@
   if (circ->cpath &&
       circ->cpath->state != CPATH_STATE_OPEN) {
     /* We failed at the first hop. If there's an OR connection
-       to blame, blame it. */
-    const char *n_conn_id = circ->_base.n_hop ?
-                              circ->_base.n_hop->identity_digest : NULL;
+     * to blame, blame it. Also, avoid this relay for a while, and
+     * fail any one-hop directory fetches destined for it. */
+    const char *n_conn_id = circ->cpath->extend_info->identity_digest;
     if (circ->_base.n_conn) {
       or_connection_t *n_conn = circ->_base.n_conn;
-      if (n_conn) n_conn_id = n_conn->identity_digest;
       log_info(LD_OR,
                "Our circuit failed to get a response from the first hop "
                "(%s:%d). I'm going to try to rotate to a better connection.",

Modified: tor/trunk/src/or/command.c
===================================================================
--- tor/trunk/src/or/command.c	2009-01-06 23:40:51 UTC (rev 17990)
+++ tor/trunk/src/or/command.c	2009-01-07 00:30:12 UTC (rev 17991)
@@ -514,8 +514,9 @@
   conn->link_proto = highest_supported_version;
   conn->handshake_state->received_versions = 1;
 
-  log_info(LD_OR, "Negotiated version %d with %s; sending NETINFO.",
-           highest_supported_version, safe_str(conn->_base.address));
+  log_info(LD_OR, "Negotiated version %d with %s:%d; sending NETINFO.",
+           highest_supported_version, safe_str(conn->_base.address),
+           conn->_base.port);
   tor_assert(conn->link_proto >= 2);
 
   if (connection_or_send_netinfo(conn) < 0) {