From 67a1658da505035c007d7bc7800e395777889a8e Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 10 Jun 2008 20:11:59 +0000 Subject: [PATCH] Fix last geoip bugs. svn:r15106 --- src/or/geoip.c | 2 +- src/or/main.c | 3 ++- src/or/routerlist.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/or/geoip.c b/src/or/geoip.c index 3d4aac974f..40ee5c8e18 100644 --- a/src/or/geoip.c +++ b/src/or/geoip.c @@ -559,7 +559,7 @@ dump_geoip_stats(void) format_iso_time(since, request_start); data_v2 = geoip_get_request_history(now, GEOIP_CLIENT_NETWORKSTATUS_V2); data_v3 = geoip_get_request_history(now, GEOIP_CLIENT_NETWORKSTATUS); - if (fprintf(out, "requests-start %s\nn-ns-reqs %s\nn-v2-ns_reqs %s\n", + if (fprintf(out, "requests-start %s\nn-ns-reqs %s\nn-v2-ns-reqs %s\n", since, data_v3 ? data_v3 : "", data_v2 ? data_v2 : "") < 0) goto done; diff --git a/src/or/main.c b/src/or/main.c index fa2708bbbd..55ab39cca6 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -962,8 +962,9 @@ run_scheduled_events(time_t now) if (time_to_dump_geoip_stats < now) { #define DUMP_GEOIP_STATS_INTERVAL (60*60); + if (time_to_dump_geoip_stats) + dump_geoip_stats(); time_to_dump_geoip_stats = now + DUMP_GEOIP_STATS_INTERVAL; - dump_geoip_stats(); } /** 2. Periodically, we consider getting a new directory, getting a diff --git a/src/or/routerlist.c b/src/or/routerlist.c index 94c43e4c05..f63e34beef 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -911,7 +911,7 @@ router_get_my_share_of_directory_requests(double *v2_share_out, share *= sl_last_exit_weight; if (rs->is_possible_guard) share *= sl_last_guard_weight; - *v2_share_out = share / U64_TO_DBL(sl_last_total_weighted_bw); + *v3_share_out = share / U64_TO_DBL(sl_last_total_weighted_bw); } }