summaryrefslogtreecommitdiff
path: root/src/or/router.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-06-18 04:34:52 +0000
committerNick Mathewson <nickm@torproject.org>2008-06-18 04:34:52 +0000
commited174245c6700bc09af6ece7df2be36b032e163a (patch)
tree72ee6e75a5df7265a637e161da36fefdf2c284cc /src/or/router.c
parent2e5e2f946a62f6e6ba8f788d3571ffd9b56e7e9f (diff)
downloadtor-ed174245c6700bc09af6ece7df2be36b032e163a.tar.gz
tor-ed174245c6700bc09af6ece7df2be36b032e163a.zip
implement more fine-tuning options for stats code
svn:r15345
Diffstat (limited to 'src/or/router.c')
-rw-r--r--src/or/router.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/or/router.c b/src/or/router.c
index 399f3138ba..4cd02370af 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -1826,8 +1826,13 @@ extrainfo_dump_to_string(char *s, size_t maxlen, extrainfo_t *extrainfo,
static time_t last_purged_at = 0;
char *geoip_summary;
time_t now = time(NULL);
- if (now > last_purged_at+48*60*60) {
- geoip_remove_old_clients(now-48*60*60);
+ int geoip_purge_interval = 48*60*60;
+#ifdef ENABLE_GEOIP_STATS
+ if (get_options()->DirRecordUsageByCountry)
+ geoip_purge_interval = get_options()->DirRecordUsageRetainIPs;
+#endif
+ if (now > last_purged_at+geoip_purge_interval) {
+ geoip_remove_old_clients(now-geoip_purge_interval);
last_purged_at = now;
}
geoip_summary = geoip_get_client_history(time(NULL), GEOIP_CLIENT_CONNECT);