summaryrefslogtreecommitdiff
path: root/src/or/circuitbuild.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-05-30 15:41:46 -0400
committerNick Mathewson <nickm@torproject.org>2011-05-30 15:41:46 -0400
commitfa1d47293b62fd378a7e43cf3ce3e7bb3be884e3 (patch)
treeb80ab67323274c8ae1e2f8097278e923c5d5d243 /src/or/circuitbuild.c
parent21de9d46e264ceb14f3fe59d17210d82f2499637 (diff)
parent7f0fb8e6083128ff20b30d8cd29c220e9427d95e (diff)
downloadtor-fa1d47293b62fd378a7e43cf3ce3e7bb3be884e3.tar.gz
tor-fa1d47293b62fd378a7e43cf3ce3e7bb3be884e3.zip
Merge remote-tracking branch 'origin/maint-0.2.2'
The conflicts were mainly caused by the routerinfo->node transition. Conflicts: src/or/circuitbuild.c src/or/command.c src/or/connection_edge.c src/or/directory.c src/or/dirserv.c src/or/relay.c src/or/rendservice.c src/or/routerlist.c
Diffstat (limited to 'src/or/circuitbuild.c')
-rw-r--r--src/or/circuitbuild.c44
1 files changed, 25 insertions, 19 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 34bb1fd065..8140cc4c4c 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -1748,10 +1748,9 @@ circuit_handle_first_hop(origin_circuit_t *circ)
if (!n_conn) {
/* not currently connected in a useful way. */
- const char *name = strlen(firsthop->extend_info->nickname) ?
- firsthop->extend_info->nickname : fmt_addr(&firsthop->extend_info->addr);
log_info(LD_CIRC, "Next router is %s: %s",
- safe_str_client(name), msg?msg:"???");
+ safe_str_client(extend_info_describe(firsthop->extend_info)),
+ msg?msg:"???");
circ->_base.n_hop = extend_info_dup(firsthop->extend_info);
if (should_launch) {
@@ -2034,7 +2033,7 @@ circuit_send_next_onion_skin(origin_circuit_t *circ)
circuit_set_state(TO_CIRCUIT(circ), CIRCUIT_STATE_BUILDING);
log_info(LD_CIRC,"First hop: finished sending %s cell to '%s'",
fast ? "CREATE_FAST" : "CREATE",
- node ? node_get_nickname(node) : "<unnamed>");
+ node ? node_describe(node) : "<unnamed>");
} else {
tor_assert(circ->cpath->state == CPATH_STATE_OPEN);
tor_assert(circ->_base.state == CIRCUIT_STATE_BUILDING);
@@ -2818,7 +2817,7 @@ choose_good_exit_server_general(int need_uptime, int need_capacity)
tor_free(n_supported);
if (node) {
- log_info(LD_CIRC, "Chose exit server '%s'", node_get_nickname(node));
+ log_info(LD_CIRC, "Chose exit server '%s'", node_describe(node));
return node;
}
if (options->ExitNodes) {
@@ -2925,7 +2924,7 @@ warn_if_last_router_excluded(origin_circuit_t *circ, const extend_info_t *exit)
log_warn(LD_BUG, "Using %s '%s' which is listed in ExcludeNodes%s, "
"even though StrictNodes is set. Please report. "
"(Circuit purpose: %s)",
- description, exit->nickname,
+ description, extend_info_describe(exit),
rs==options->ExcludeNodes?"":" or ExcludeExitNodes",
circuit_purpose_to_string(purpose));
} else {
@@ -2934,7 +2933,7 @@ warn_if_last_router_excluded(origin_circuit_t *circ, const extend_info_t *exit)
"prevent this (and possibly break your Tor functionality), "
"set the StrictNodes configuration option. "
"(Circuit purpose: %s)",
- description, exit->nickname,
+ description, extend_info_describe(exit),
rs==options->ExcludeNodes?"":" or ExcludeExitNodes",
circuit_purpose_to_string(purpose));
}
@@ -2964,7 +2963,8 @@ onion_pick_cpath_exit(origin_circuit_t *circ, extend_info_t *exit)
if (exit) { /* the circuit-builder pre-requested one */
warn_if_last_router_excluded(circ, exit);
- log_info(LD_CIRC,"Using requested exit node '%s'", exit->nickname);
+ log_info(LD_CIRC,"Using requested exit node '%s'",
+ extend_info_describe(exit));
exit = extend_info_dup(exit);
} else { /* we have to decide one */
const node_t *node =
@@ -3014,8 +3014,8 @@ circuit_extend_to_new_exit(origin_circuit_t *circ, extend_info_t *exit)
circuit_append_new_exit(circ, exit);
circuit_set_state(TO_CIRCUIT(circ), CIRCUIT_STATE_BUILDING);
if ((err_reason = circuit_send_next_onion_skin(circ))<0) {
- log_warn(LD_CIRC, "Couldn't extend circuit to new point '%s'.",
- exit->nickname);
+ log_warn(LD_CIRC, "Couldn't extend circuit to new point %s.",
+ extend_info_describe(exit));
circuit_mark_for_close(TO_CIRCUIT(circ), -err_reason);
return -1;
}
@@ -3239,7 +3239,8 @@ onion_extend_cpath(origin_circuit_t *circ)
}
log_debug(LD_CIRC,"Chose router %s for hop %d (exit is %s)",
- info->nickname, cur_len+1, build_state_get_exit_nickname(state));
+ extend_info_describe(info),
+ cur_len+1, build_state_get_exit_nickname(state));
onion_append_hop(&circ->cpath, info);
extend_info_free(info);
@@ -3541,20 +3542,24 @@ log_entry_guards(int severity)
smartlist_t *elements = smartlist_create();
char *s;
- SMARTLIST_FOREACH(entry_guards, entry_guard_t *, e,
+ SMARTLIST_FOREACH_BEGIN(entry_guards, entry_guard_t *, e)
{
const char *msg = NULL;
char *cp;
if (entry_is_live(e, 0, 1, 0, &msg))
- tor_asprintf(&cp, "%s (up %s)",
+ tor_asprintf(&cp, "%s [%s] (up %s)",
e->nickname,
+ hex_str(e->identity, DIGEST_LEN),
e->made_contact ? "made-contact" : "never-contacted");
else
- tor_asprintf(&cp, "%s (%s, %s)",
- e->nickname, msg,
+ tor_asprintf(&cp, "%s [%s] (%s, %s)",
+ e->nickname,
+ hex_str(e->identity, DIGEST_LEN),
+ msg,
e->made_contact ? "made-contact" : "never-contacted");
smartlist_add(elements, cp);
- });
+ }
+ SMARTLIST_FOREACH_END(e);
s = smartlist_join_strings(elements, ",", 0, NULL);
SMARTLIST_FOREACH(elements, char*, cp, tor_free(cp));
@@ -3622,8 +3627,8 @@ add_an_entry_guard(const node_t *chosen, int reset_status)
return NULL;
}
entry = tor_malloc_zero(sizeof(entry_guard_t));
- log_info(LD_CIRC, "Chose '%s' as new entry guard.",
- node_get_nickname(node));
+ log_info(LD_CIRC, "Chose %s as new entry guard.",
+ node_describe(node));
strlcpy(entry->nickname, node_get_nickname(node), sizeof(entry->nickname));
memcpy(entry->identity, node->identity, DIGEST_LEN);
/* Choose expiry time smudged over the past month. The goal here
@@ -3813,8 +3818,9 @@ entry_guards_compute_status(or_options_t *options, time_t now)
const char *reason = digestmap_get(reasons, entry->identity);
const char *live_msg = "";
const node_t *r = entry_is_live(entry, 0, 1, 0, &live_msg);
- log_info(LD_CIRC, "Summary: Entry '%s' is %s, %s%s%s, and %s%s.",
+ log_info(LD_CIRC, "Summary: Entry %s [%s] is %s, %s%s%s, and %s%s.",
entry->nickname,
+ hex_str(entry->identity, DIGEST_LEN),
entry->unreachable_since ? "unreachable" : "reachable",
entry->bad_since ? "unusable" : "usable",
reason ? ", ": "",