diff options
author | Karsten Loesing <karsten.loesing@gmx.net> | 2009-05-27 17:52:46 +0200 |
---|---|---|
committer | Karsten Loesing <karsten.loesing@gmx.net> | 2009-05-27 19:13:31 +0200 |
commit | 54c97c9133ebbeea6aed9b4526b19fbc0d88377b (patch) | |
tree | 4357577684ab5acc0928b543ef88b002d325a9c3 /src/or/router.c | |
parent | bf7e5d6553acd8d8ce37e80586083620d66d0160 (diff) | |
download | tor-54c97c9133ebbeea6aed9b4526b19fbc0d88377b.tar tor-54c97c9133ebbeea6aed9b4526b19fbc0d88377b.tar.gz |
Change the way how directories that are configured with --enable-geoip-stats write geoip stats to disk.
- Write geoip stats to disk every 24 hours, not every hour.
- Remove configuration options and define reasonable defaults.
- Clear history of client requests every 24 hours (which wasn't done at
all before).
Diffstat (limited to 'src/or/router.c')
-rw-r--r-- | src/or/router.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/or/router.c b/src/or/router.c index da922b750..6d6f8dad3 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -1915,10 +1915,13 @@ extrainfo_get_client_geoip_summary(time_t now) static time_t last_purged_at = 0; int geoip_purge_interval = 48*60*60; #ifdef ENABLE_GEOIP_STATS - if (get_options()->DirRecordUsageByCountry) - geoip_purge_interval = get_options()->DirRecordUsageRetainIPs; + geoip_purge_interval = DIR_RECORD_USAGE_RETAIN_IPS; #endif if (now > last_purged_at+geoip_purge_interval) { + /* (Note that this also discards items in the client history with + * action GEOIP_CLIENT_NETWORKSTATUS{_V2}, which doesn't matter + * because bridge and directory stats are independent. Keep in mind + * for future extensions, though.) */ geoip_remove_old_clients(now-geoip_purge_interval); last_purged_at = now; } |