From b95dd03e5f6505ce2e78fe34a20bf5e5c970e6eb Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Sun, 15 May 2011 21:58:46 -0400 Subject: Log descriptions of nodes, not just nicknames. This patch introduces a few new functions in router.c to produce a more helpful description of a node than its nickame, and then tweaks nearly all log messages taking a nickname as an argument to call these functions instead. There are a few cases where I left the old log messages alone: in these cases, the nickname was that of an authority (whose nicknames are useful and unique), or the message already included an identity and/or an address. I might have missed a couple more too. This is a fix for bug 3045. --- src/or/rephist.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/or/rephist.c') diff --git a/src/or/rephist.c b/src/or/rephist.c index 8cddd2b5e..6be8484cc 100644 --- a/src/or/rephist.c +++ b/src/or/rephist.c @@ -634,6 +634,7 @@ rep_hist_dump_stats(time_t now, int severity) digestmap_iter_t *orhist_it; const char *name1, *name2, *digest1, *digest2; char hexdigest1[HEX_DIGEST_LEN+1]; + char hexdigest2[HEX_DIGEST_LEN+1]; or_history_t *or_history; link_history_t *link_history; void *or_history_p, *link_history_p; @@ -694,7 +695,10 @@ rep_hist_dump_stats(time_t now, int severity) link_history = (link_history_t*) link_history_p; - ret = tor_snprintf(buffer+len, 2048-len, "%s(%ld/%ld); ", name2, + base16_encode(hexdigest2, sizeof(hexdigest2), digest2, DIGEST_LEN); + ret = tor_snprintf(buffer+len, 2048-len, "%s [%s](%ld/%ld); ", + name2, + hexdigest2, link_history->n_extend_ok, link_history->n_extend_ok+link_history->n_extend_fail); if (ret<0) -- cgit v1.2.3