diff options
author | Karsten Loesing <karsten.loesing@gmx.net> | 2010-08-02 15:06:14 +0200 |
---|---|---|
committer | Karsten Loesing <karsten.loesing@gmx.net> | 2010-12-03 16:47:51 +0100 |
commit | 5dfdf075ac0cb3df66443011d3faa2c95dc53629 (patch) | |
tree | 7bd0ca2f3b876499a6310740ef838bf74afaeced /src/or/router.c | |
parent | 520182579a4c186e94a1ada1d66c09c89ee3f3c4 (diff) | |
download | tor-5dfdf075ac0cb3df66443011d3faa2c95dc53629.tar.gz tor-5dfdf075ac0cb3df66443011d3faa2c95dc53629.zip |
Add metric on uni/bidirectional connection usage.
Diffstat (limited to 'src/or/router.c')
-rw-r--r-- | src/or/router.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/or/router.c b/src/or/router.c index 1f3967d3d5..b612e9a7fb 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -2051,6 +2051,19 @@ extrainfo_dump_to_string(char **s_out, extrainfo_t *extrainfo, "exit-stats-end", now, &contents) > 0) { smartlist_add(chunks, contents); } + if (options->ConnStatistics && + load_stats_file("stats"PATH_SEPARATOR"conn-stats", + "conn-stats-end", now, &contents) > 0) { + size_t pos = strlen(s); + if (strlcpy(s + pos, contents, maxlen - strlen(s)) != + strlen(contents)) { + log_warn(LD_DIR, "Could not write conn-stats to extra-info " + "descriptor."); + s[pos] = '\0'; + write_stats_to_extrainfo = 0; + } + tor_free(contents); + } } if (should_record_bridge_info(options) && write_stats_to_extrainfo) { |