diff options
author | Nick Mathewson <nickm@torproject.org> | 2008-05-28 18:31:57 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2008-05-28 18:31:57 +0000 |
commit | bd3b86df3b18cbded5f69de2f4ed5f7c5e2487e3 (patch) | |
tree | 4da84f352c203f6a28d35786fa347ac9efbeaf36 /src/or/router.c | |
parent | dd715016ddb4a9c377da7586561e54237c405c03 (diff) | |
download | tor-bd3b86df3b18cbded5f69de2f4ed5f7c5e2487e3.tar.gz tor-bd3b86df3b18cbded5f69de2f4ed5f7c5e2487e3.zip |
Several geoip changes/fixes as requested.
svn:r14780
Diffstat (limited to 'src/or/router.c')
-rw-r--r-- | src/or/router.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/or/router.c b/src/or/router.c index eb09ac4947..8f2bf65482 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -1823,7 +1823,14 @@ extrainfo_dump_to_string(char *s, size_t maxlen, extrainfo_t *extrainfo, return -1; if (options->BridgeRelay && options->BridgeRecordUsageByCountry) { - char *geoip_summary = geoip_get_client_history(time(NULL)); + 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); + last_purged_at = now; + } + geoip_summary = geoip_get_client_history(time(NULL)); if (geoip_summary) { char geoip_start[ISO_TIME_LEN+1]; format_iso_time(geoip_start, geoip_get_history_start()); |