aboutsummaryrefslogtreecommitdiff
path: root/src/or/circuitbuild.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/or/circuitbuild.c')
-rw-r--r--src/or/circuitbuild.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index aef1442aa..4666e4ded 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -755,8 +755,8 @@ circuit_extend(cell_t *cell, circuit_t *circ)
char tmpbuf[INET_NTOA_BUF_LEN];
in.s_addr = htonl(circ->n_addr);
tor_inet_ntoa(&in,tmpbuf,sizeof(tmpbuf));
- log_info(LD_CIRC|LD_OR,"Next router (%s:%d) not connected. Connecting.",
- tmpbuf, circ->n_port);
+ log_debug(LD_CIRC|LD_OR,"Next router (%s:%d) not connected. Connecting.",
+ tmpbuf, circ->n_port);
circ->n_conn_onionskin = tor_malloc(ONIONSKIN_CHALLENGE_LEN);
memcpy(circ->n_conn_onionskin, onionskin, ONIONSKIN_CHALLENGE_LEN);
@@ -2169,8 +2169,9 @@ entry_guards_compute_status(void)
{
time_t now;
int changed = 0;
- int severity = LOG_INFO;
+ int severity = LOG_DEBUG;
or_options_t *options;
+ const char **reasons;
if (! entry_guards)
return;
@@ -2178,6 +2179,7 @@ entry_guards_compute_status(void)
now = time(NULL);
+ reasons = tor_malloc_zero(smartlist_len(entry_guards) * sizeof(char*));
SMARTLIST_FOREACH(entry_guards, entry_guard_t *, entry,
{
routerinfo_t *r = router_get_by_digest(entry->identity);
@@ -2187,24 +2189,28 @@ entry_guards_compute_status(void)
if (entry->bad_since)
tor_assert(reason);
-
- log_info(LD_CIRC, "Summary: Entry '%s' is %s, %s%s, and %s.",
- entry->nickname,
- entry->unreachable_since ? "unreachable" : "reachable",
- entry->bad_since ? "unusable: " : "usable",
- entry->bad_since ? reason : "",
- entry_is_live(entry, 0, 1, 0) ? "live" : "not live");
+ reasons[entry_sl_idx] = reason;
});
if (remove_dead_entry_guards())
changed = 1;
+ severity = changed ? LOG_DEBUG : LOG_INFO;
+
if (changed) {
- log_fn(severity, LD_CIRC, " (%d/%d entry guards are usable/new)",
- num_live_entry_guards(), smartlist_len(entry_guards));
+ SMARTLIST_FOREACH(entry_guards, entry_guard_t *, entry,
+ log_info(LD_CIRC, "Summary: Entry '%s' is %s, %s%s, and %s.",
+ entry->nickname,
+ entry->unreachable_since ? "unreachable" : "reachable",
+ entry->bad_since ? "unusable: " : "usable",
+ reasons[entry_sl_idx] ? reasons[entry_sl_idx] : "",
+ entry_is_live(entry, 0, 1, 0) ? "live" : "not live"));
+ log_info(LD_CIRC, " (%d/%d entry guards are usable/new)",
+ num_live_entry_guards(), smartlist_len(entry_guards));
log_entry_guards(LOG_INFO);
entry_guards_changed();
}
+ tor_free(reasons);
}
/** Called when a connection to an OR with the identity digest <b>digest</b>