From 31008317620c26ec9925592e1f867ef03a1125c4 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Sun, 30 Sep 2018 23:42:21 -0500 Subject: 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/feature/dirparse/routerparse.c | 30 ------------------------------ src/feature/dirparse/routerparse.h | 1 - 2 files changed, 31 deletions(-) (limited to 'src/feature/dirparse') diff --git a/src/feature/dirparse/routerparse.c b/src/feature/dirparse/routerparse.c index b439b79de8..05013ef7f4 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 in toto, 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 list of directory_token_t's * with at least one argument (use GE(1) in setup). If found, store * address and port number to addr_out 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 e6ab751fa8..7b514afbba 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); -- cgit v1.2.3-54-g00ecf