aboutsummaryrefslogtreecommitdiff
path: root/src/or/rephist.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2007-12-19 04:58:58 +0000
committerRoger Dingledine <arma@torproject.org>2007-12-19 04:58:58 +0000
commitf405f9b6140d9f001bb96364dc4c240afc222103 (patch)
tree8c16b2430bf2e4b0a19e010d640cb0291db17152 /src/or/rephist.c
parenta697573ce911f0b16e5cb5e8d73d4863883f82ac (diff)
downloadtor-f405f9b6140d9f001bb96364dc4c240afc222103.tar.gz
tor-f405f9b6140d9f001bb96364dc4c240afc222103.zip
Make getinfo ns/purpose/bridge actually work
Also, dump our bridge router status entries to disk every 30 minutes. svn:r12871
Diffstat (limited to 'src/or/rephist.c')
-rw-r--r--src/or/rephist.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/or/rephist.c b/src/or/rephist.c
index 1561540d02..2c84e40c2f 100644
--- a/src/or/rephist.c
+++ b/src/or/rephist.c
@@ -2153,21 +2153,21 @@ hs_usage_format_statistics(void)
return buf;
}
-/** Writes current statistics to file. */
+/** Write current statistics about hidden service usage to file. */
void
hs_usage_write_statistics_to_file(time_t now)
{
char *buf;
size_t len;
char *fname;
- or_options_t *options;
+ or_options_t *options = get_options();
/* check if we are up-to-date */
hs_usage_check_if_current_period_is_up_to_date(now);
buf = hs_usage_format_statistics();
- options = get_options();
len = strlen(options->DataDirectory) + 16;
fname = tor_malloc(len);
- tor_snprintf(fname,len, "%s"PATH_SEPARATOR"hsusage", options->DataDirectory);
+ tor_snprintf(fname, len, "%s"PATH_SEPARATOR"hsusage",
+ options->DataDirectory);
write_str_to_file(fname,buf,0);
tor_free(buf);
tor_free(fname);