[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r15104: Small formatting fixes for geoip-stats file. (in tor/trunk: . src/or)



Author: nickm
Date: 2008-06-10 15:25:25 -0400 (Tue, 10 Jun 2008)
New Revision: 15104

Modified:
   tor/trunk/
   tor/trunk/src/or/geoip.c
Log:
 r16139@tombo:  nickm | 2008-06-10 15:25:23 -0400
 Small formatting fixes for geoip-stats file.



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r16139] on 49666b30-7950-49c5-bedf-9dc8f3168102

Modified: tor/trunk/src/or/geoip.c
===================================================================
--- tor/trunk/src/or/geoip.c	2008-06-10 19:11:02 UTC (rev 15103)
+++ tor/trunk/src/or/geoip.c	2008-06-10 19:25:25 UTC (rev 15104)
@@ -511,6 +511,8 @@
       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 @@
                                     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 @@
   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;