Fix last geoip bugs.

svn:r15106
This commit is contained in:
Nick Mathewson 2008-06-10 20:11:59 +00:00
parent 16b62a01e4
commit 67a1658da5
3 changed files with 4 additions and 3 deletions

View File

@ -559,7 +559,7 @@ dump_geoip_stats(void)
format_iso_time(since, request_start); format_iso_time(since, request_start);
data_v2 = geoip_get_request_history(now, GEOIP_CLIENT_NETWORKSTATUS_V2); data_v2 = geoip_get_request_history(now, GEOIP_CLIENT_NETWORKSTATUS_V2);
data_v3 = geoip_get_request_history(now, GEOIP_CLIENT_NETWORKSTATUS); 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, since,
data_v3 ? data_v3 : "", data_v2 ? data_v2 : "") < 0) data_v3 ? data_v3 : "", data_v2 ? data_v2 : "") < 0)
goto done; goto done;

View File

@ -962,8 +962,9 @@ run_scheduled_events(time_t now)
if (time_to_dump_geoip_stats < now) { if (time_to_dump_geoip_stats < now) {
#define DUMP_GEOIP_STATS_INTERVAL (60*60); #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; time_to_dump_geoip_stats = now + DUMP_GEOIP_STATS_INTERVAL;
dump_geoip_stats();
} }
/** 2. Periodically, we consider getting a new directory, getting a /** 2. Periodically, we consider getting a new directory, getting a

View File

@ -911,7 +911,7 @@ router_get_my_share_of_directory_requests(double *v2_share_out,
share *= sl_last_exit_weight; share *= sl_last_exit_weight;
if (rs->is_possible_guard) if (rs->is_possible_guard)
share *= sl_last_guard_weight; 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);
} }
} }