[tor-commits] [tor/master] Remove dump_distinct_digest_count()

nickm at torproject.org nickm at torproject.org
Fri Oct 12 15:39:44 UTC 2018


commit 31008317620c26ec9925592e1f867ef03a1125c4
Author: Nick Mathewson <nickm at torproject.org>
Date:   Sun Sep 30 23:42:21 2018 -0500

    Remove dump_distinct_digest_count()
    
    It was disabled-by-default for ages, and it no longer compiles. I
    think it's safe to call it obsolete.
---
 src/app/main/main.c                |  1 -
 src/feature/dirparse/routerparse.c | 30 ------------------------------
 src/feature/dirparse/routerparse.h |  1 -
 3 files changed, 32 deletions(-)

diff --git a/src/app/main/main.c b/src/app/main/main.c
index 2e3efadc0..ae87add67 100644
--- a/src/app/main/main.c
+++ b/src/app/main/main.c
@@ -424,7 +424,6 @@ dumpstats(int severity)
 
   rep_hist_dump_stats(now,severity);
   rend_service_dump_stats(severity);
-  dump_distinct_digest_count(severity);
 }
 
 /** Called by exit() as we shut down the process.
diff --git a/src/feature/dirparse/routerparse.c b/src/feature/dirparse/routerparse.c
index b439b79de..05013ef7f 100644
--- a/src/feature/dirparse/routerparse.c
+++ b/src/feature/dirparse/routerparse.c
@@ -537,31 +537,6 @@ router_parse_list_from_string(const char **s, const char *eos,
   return 0;
 }
 
-/* For debugging: define to count every descriptor digest we've seen so we
- * know if we need to try harder to avoid duplicate verifies. */
-#undef COUNT_DISTINCT_DIGESTS
-
-#ifdef COUNT_DISTINCT_DIGESTS
-static digestmap_t *verified_digests = NULL;
-#endif
-
-/** Log the total count of the number of distinct router digests we've ever
- * verified.  When compared to the number of times we've verified routerdesc
- * signatures <i>in toto</i>, this will tell us if we're doing too much
- * multiple-verification. */
-void
-dump_distinct_digest_count(int severity)
-{
-#ifdef COUNT_DISTINCT_DIGESTS
-  if (!verified_digests)
-    verified_digests = digestmap_new();
-  tor_log(severity, LD_GENERAL, "%d *distinct* router digests verified",
-      digestmap_size(verified_digests));
-#else /* !(defined(COUNT_DISTINCT_DIGESTS)) */
-  (void)severity; /* suppress "unused parameter" warning */
-#endif /* defined(COUNT_DISTINCT_DIGESTS) */
-}
-
 /** Try to find an IPv6 OR port in <b>list</b> of directory_token_t's
  * with at least one argument (use GE(1) in setup). If found, store
  * address and port number to <b>addr_out</b> and
@@ -1139,11 +1114,6 @@ router_parse_entry_from_string(const char *s, const char *end,
   }
 
   tok = find_by_keyword(tokens, K_ROUTER_SIGNATURE);
-#ifdef COUNT_DISTINCT_DIGESTS
-  if (!verified_digests)
-    verified_digests = digestmap_new();
-  digestmap_set(verified_digests, signed_digest, (void*)(uintptr_t)1);
-#endif
 
   if (!router->or_port) {
     log_warn(LD_DIR,"or_port unreadable or 0. Failing.");
diff --git a/src/feature/dirparse/routerparse.h b/src/feature/dirparse/routerparse.h
index e6ab751fa..7b514afbb 100644
--- a/src/feature/dirparse/routerparse.h
+++ b/src/feature/dirparse/routerparse.h
@@ -47,7 +47,6 @@ MOCK_DECL(addr_policy_t *, router_parse_addr_policy_item_from_string,
          (const char *s, int assume_action, int *malformed_list));
 
 void assert_addr_policy_ok(smartlist_t *t);
-void dump_distinct_digest_count(int severity);
 
 int compare_vote_routerstatus_entries(const void **_a, const void **_b);
 int networkstatus_verify_bw_weights(networkstatus_t *ns, int);





More information about the tor-commits mailing list