diff options
author | Nick Mathewson <nickm@torproject.org> | 2019-01-14 14:02:42 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2019-01-14 14:02:42 -0500 |
commit | 691dec5d4615dec9a845d0f7dea7ef55cc66fe62 (patch) | |
tree | 9801540d5b511be02947edea4437b59c7cb6aac7 /src | |
parent | 99947c3ce0a34f8a2dd8c201f8ef348666da403a (diff) | |
parent | 9d9e71824cc228123aebd28b7b08fb9fb30d36b1 (diff) | |
download | tor-691dec5d4615dec9a845d0f7dea7ef55cc66fe62.tar.gz tor-691dec5d4615dec9a845d0f7dea7ef55cc66fe62.zip |
Merge branch 'maint-0.3.5'
Diffstat (limited to 'src')
-rw-r--r-- | src/feature/stats/rephist.c | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/src/feature/stats/rephist.c b/src/feature/stats/rephist.c index 37c4759f37..3967a548b5 100644 --- a/src/feature/stats/rephist.c +++ b/src/feature/stats/rephist.c @@ -2874,24 +2874,23 @@ rep_hist_get_padding_count_lines(void) void rep_hist_log_link_protocol_counts(void) { - log_notice(LD_HEARTBEAT, - "Since startup, we have initiated " - "%"PRIu64" v1 connections, " - "%"PRIu64" v2 connections, " - "%"PRIu64" v3 connections, and " - "%"PRIu64" v4 connections; and received " - "%"PRIu64" v1 connections, " - "%"PRIu64" v2 connections, " - "%"PRIu64" v3 connections, and " - "%"PRIu64" v4 connections.", - (link_proto_count[1][1]), - (link_proto_count[2][1]), - (link_proto_count[3][1]), - (link_proto_count[4][1]), - (link_proto_count[1][0]), - (link_proto_count[2][0]), - (link_proto_count[3][0]), - (link_proto_count[4][0])); + smartlist_t *lines = smartlist_new(); + + for (int i = 1; i <= MAX_LINK_PROTO; i++) { + char *line = NULL; + tor_asprintf(&line, "initiated %"PRIu64" and received " + "%"PRIu64" v%d connections", link_proto_count[i][1], + link_proto_count[i][0], i); + smartlist_add(lines, line); + } + + char *log_line = smartlist_join_strings(lines, "; ", 0, NULL); + + log_notice(LD_HEARTBEAT, "Since startup we %s.", log_line); + + SMARTLIST_FOREACH(lines, char *, s, tor_free(s)); + smartlist_free(lines); + tor_free(log_line); } /** Free all storage held by the OR/link history caches, by the |