diff options
author | Nick Mathewson <nickm@torproject.org> | 2008-05-29 02:29:35 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2008-05-29 02:29:35 +0000 |
commit | ac330d9ba72c2379372682216b329f384dbe30fe (patch) | |
tree | 35a3f7992afe4d4007d3aca45b2819bb70de2dbc /src/or/main.c | |
parent | 6e68c23de74e613fb06cb4412c854845e46bed43 (diff) | |
download | tor-ac330d9ba72c2379372682216b329f384dbe30fe.tar.gz tor-ac330d9ba72c2379372682216b329f384dbe30fe.zip |
New code to implement proposal for local geoip stats. Only enabled with --enable-geoip-stats passed to configure.
svn:r14802
Diffstat (limited to 'src/or/main.c')
-rw-r--r-- | src/or/main.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/or/main.c b/src/or/main.c index 2dc4b0697a..6993103a2d 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -832,6 +832,7 @@ run_scheduled_events(time_t now) static time_t time_to_clean_caches = 0; static time_t time_to_recheck_bandwidth = 0; static time_t time_to_check_for_expired_networkstatus = 0; + static time_t time_to_dump_geoip_stats = 0; or_options_t *options = get_options(); int i; int have_dir_info; @@ -958,6 +959,12 @@ run_scheduled_events(time_t now) time_to_check_for_expired_networkstatus = now + CHECK_EXPIRED_NS_INTERVAL; } + if (time_to_dump_geoip_stats < now) { +#define DUMP_GEOIP_STATS_INTERVAL (60*60); + time_to_dump_geoip_stats = now + DUMP_GEOIP_STATS_INTERVAL; + dump_geoip_stats(); + } + /** 2. Periodically, we consider getting a new directory, getting a * new running-routers list, and/or force-uploading our descriptor * (if we've passed our internal checks). */ |