diff options
author | Nick Mathewson <nickm@torproject.org> | 2008-03-17 04:07:51 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2008-03-17 04:07:51 +0000 |
commit | e6b617bf0555054e5a3e20748ef27dfd9e75af13 (patch) | |
tree | d46e5cb7ccf009de073de94146d68610faadb773 /src/or/circuitbuild.c | |
parent | c59f66709d024dfb112d1f648b14aeec057e1308 (diff) | |
download | tor-e6b617bf0555054e5a3e20748ef27dfd9e75af13.tar.gz tor-e6b617bf0555054e5a3e20748ef27dfd9e75af13.zip |
r18872@catbus: nickm | 2008-03-16 23:56:48 -0400
Only dump all guard node status to the log when the guard node status actually changes. Downgrade the 4 most common remaining INFO log messages to DEBUG.
svn:r14069
Diffstat (limited to 'src/or/circuitbuild.c')
-rw-r--r-- | src/or/circuitbuild.c | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index aef1442aad..4666e4ded2 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> |