]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
actually find the right identity_digest to blame when we get
authorRoger Dingledine <arma@torproject.org>
Wed, 7 Jan 2009 00:30:12 +0000 (00:30 +0000)
committerRoger Dingledine <arma@torproject.org>
Wed, 7 Jan 2009 00:30:12 +0000 (00:30 +0000)
a destroy cell from our first hop.

svn:r17991

src/or/circuituse.c
src/or/command.c

index f2c1595c3b2a2355f03aee68c4cf27bba78275cd..ac1a64ebfac652250761db41d6db6dec60119f68 100644 (file)
@@ -800,12 +800,11 @@ circuit_build_failed(origin_circuit_t *circ)
   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.",
index 4dcdc136bba0bf979e071802e3116ca633ddb9f1..c6e2c12979008aa9260c8eb25c3bc6ed264bcd4b 100644 (file)
@@ -514,8 +514,9 @@ command_process_versions_cell(var_cell_t *cell, or_connection_t *conn)
   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) {