]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Merge commit 'karsten/geoipstats-download-resp-master'
authorNick Mathewson <nickm@torproject.org>
Tue, 14 Jul 2009 16:18:27 +0000 (12:18 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 14 Jul 2009 16:18:27 +0000 (12:18 -0400)
Conflicts:
src/or/geoip.c

1  2 
src/or/directory.c
src/or/geoip.c
src/or/or.h

Simple merge
diff --cc src/or/geoip.c
index 6cfc1392bb7265a181dcd16f33ac62df26886b38,a182e213a5c3967aafa2cc359c00ae84f2ae6bc2..0aa5fd873b9d2201495b430d3f8bf7fc221201cf
@@@ -711,7 -675,34 +749,34 @@@ dump_geoip_stats(void
                since,
                data_v3 ? data_v3 : "", data_v2 ? data_v2 : "") < 0)
      goto done;
 -  if (!router_get_my_share_of_directory_requests(&v2_share, &v3_share)) {
+ #define RESPONSE_GRANULARITY 8
+   for (i = 0; i < GEOIP_NS_RESPONSE_NUM; i++) {
+     ns_v2_responses[i] = round_uint32_to_next_multiple_of(
+                                ns_v2_responses[i], RESPONSE_GRANULARITY);
+     ns_v3_responses[i] = round_uint32_to_next_multiple_of(
+                                ns_v3_responses[i], RESPONSE_GRANULARITY);
+   }
+ #undef RESPONSE_GRANULARITY
+   if (fprintf(out, "n-ns-resp ok=%u,not-enough-sigs=%u,unavailable=%u,"
+                    "not-found=%u,not-modified=%u,busy=%u\n",
+                    ns_v3_responses[GEOIP_SUCCESS],
+                    ns_v3_responses[GEOIP_REJECT_NOT_ENOUGH_SIGS],
+                    ns_v3_responses[GEOIP_REJECT_UNAVAILABLE],
+                    ns_v3_responses[GEOIP_REJECT_NOT_FOUND],
+                    ns_v3_responses[GEOIP_REJECT_NOT_MODIFIED],
+                    ns_v3_responses[GEOIP_REJECT_BUSY]) < 0)
+     goto done;
+   if (fprintf(out, "n-v2-ns-resp ok=%u,unavailable=%u,"
+                    "not-found=%u,not-modified=%u,busy=%u\n",
+                    ns_v2_responses[GEOIP_SUCCESS],
+                    ns_v2_responses[GEOIP_REJECT_UNAVAILABLE],
+                    ns_v2_responses[GEOIP_REJECT_NOT_FOUND],
+                    ns_v2_responses[GEOIP_REJECT_NOT_MODIFIED],
+                    ns_v2_responses[GEOIP_REJECT_BUSY]) < 0)
+     goto done;
+   memset(ns_v2_responses, 0, sizeof(ns_v2_responses));
+   memset(ns_v3_responses, 0, sizeof(ns_v3_responses));
 +  if (!geoip_get_mean_shares(now, &v2_share, &v3_share)) {
      if (fprintf(out, "v2-ns-share %0.2lf%%\n", v2_share*100) < 0)
        goto done;
      if (fprintf(out, "v3-ns-share %0.2lf%%\n", v3_share*100) < 0)
diff --cc src/or/or.h
Simple merge