diff options
author | Nick Mathewson <nickm@torproject.org> | 2008-06-10 19:25:25 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2008-06-10 19:25:25 +0000 |
commit | e3d1ad67f669a8a052a837f6a3dc632e03cae261 (patch) | |
tree | 41d0c6556bd699ea7651b02157448eec07a8d4fb /src/or/geoip.c | |
parent | 8d484b64e41c41a6cab1e72120f065c1ab674a0d (diff) | |
download | tor-e3d1ad67f669a8a052a837f6a3dc632e03cae261.tar.gz tor-e3d1ad67f669a8a052a837f6a3dc632e03cae261.zip |
r16139@tombo: nickm | 2008-06-10 15:25:23 -0400
Small formatting fixes for geoip-stats file.
svn:r15104
Diffstat (limited to 'src/or/geoip.c')
-rw-r--r-- | src/or/geoip.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/or/geoip.c b/src/or/geoip.c index 39d31751aa..fb9ae25939 100644 --- a/src/or/geoip.c +++ b/src/or/geoip.c @@ -511,6 +511,8 @@ geoip_get_request_history(time_t now, geoip_client_action_t action) char buf[32]; for (i=0; i < REQUEST_HIST_LEN; ++i) tot += n[i]; + if (!tot) + continue; tor_snprintf(buf, sizeof(buf), "%s=%ld", c->countrycode, (long)tot); smartlist_add(entries, tor_strdup(buf)); }); @@ -541,7 +543,7 @@ dump_geoip_stats(void) 0600, &open_file); if (!out) goto done; - if (fprintf(out, "written %s\nstarted-at %s\nns-ips %s\nns-v2-ips%s\n", + if (fprintf(out, "written %s\nstarted-at %s\nns-ips %s\nns-v2-ips %s\n", written, since, data_v3 ? data_v3 : "", data_v2 ? data_v2 : "") < 0) goto done; @@ -553,7 +555,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; |