[or-cvs] r17199: {tor} Remove bug 811/845 debugging code (tor/trunk/src/or)

nickm at seul.org nickm at seul.org
Fri Nov 7 01:50:38 UTC 2008


Author: nickm
Date: 2008-11-06 20:50:37 -0500 (Thu, 06 Nov 2008)
New Revision: 17199

Modified:
   tor/trunk/src/or/or.h
   tor/trunk/src/or/policies.c
Log:
Remove bug 811/845 debugging code

Modified: tor/trunk/src/or/or.h
===================================================================
--- tor/trunk/src/or/or.h	2008-11-07 01:48:55 UTC (rev 17198)
+++ tor/trunk/src/or/or.h	2008-11-07 01:50:37 UTC (rev 17199)
@@ -4223,12 +4223,10 @@
   CRN_NEED_CAPACITY = 1<<1,
   CRN_NEED_GUARD = 1<<2,
   CRN_ALLOW_INVALID = 1<<3,
-#if 0
   /* XXXX021 not used, apparently. */
   CRN_STRICT_PREFERRED = 1<<4,
   /* XXXX021 not used, apparently. */
   CRN_WEIGHT_AS_EXIT = 1<<5
-#endif
 } router_crn_flags_t;
 
 routerinfo_t *router_choose_random_node(const char *preferred,

Modified: tor/trunk/src/or/policies.c
===================================================================
--- tor/trunk/src/or/policies.c	2008-11-07 01:48:55 UTC (rev 17198)
+++ tor/trunk/src/or/policies.c	2008-11-07 01:50:37 UTC (rev 17199)
@@ -1237,48 +1237,6 @@
         search.policy = p;
         found = HT_REMOVE(policy_map, &policy_root, &search);
         if (found) {
-          if (p != found->policy) {
-            /* Debugging code for bug 811/845. XXXX021 remove once that's
-             * fixed. */
-            char *t1, *t2;
-            char b1[TOR_ADDR_BUF_LEN], b2[TOR_ADDR_BUF_LEN];
-            switch (p->policy_type) {
-              case ADDR_POLICY_ACCEPT: t1 = tor_strdup("accept"); break;
-              case ADDR_POLICY_REJECT: t1 = tor_strdup("reject"); break;
-              default:
-                t1 = tor_malloc(16);
-                tor_snprintf(t1, 16, "%d", (int)p->policy_type);
-                break;
-            }
-            switch (found->policy->policy_type) {
-              case ADDR_POLICY_ACCEPT: t2 = tor_strdup("accept"); break;
-              case ADDR_POLICY_REJECT: t2 = tor_strdup("reject"); break;
-              default:
-                t2 = tor_malloc(16);
-                tor_snprintf(t2, 16, "%d", (int)found->policy->policy_type);
-                break;
-            }
-
-            tor_addr_to_str(b1, &p->addr, sizeof(b1), 1);
-            tor_addr_to_str(b2, &found->policy->addr, sizeof(b2), 1);
-            log_err(LD_GENERAL,
-                    "Mismatch between cached policy and freed policy. "
-                    "p==%s %s/%d:%d-%d%s%s.  "
-                    "found->policy==%s %s/%d:%d-%d%s%s.",
-                    t1, b1, (int)p->maskbits, (int)p->prt_min, (int)p->prt_max,
-                      p->is_private?" [Private]":"",
-                      p->is_canonical?" [Canonical]":"",
-                    t2, b2, (int)found->policy->maskbits,
-                      (int)found->policy->prt_min, (int)found->policy->prt_max,
-                      found->policy->is_private?" [Private]":"",
-                      found->policy->is_canonical?" [Canonical]":"");
-
-            log_err(LD_GENERAL,
-              "cmp_single_addr_policy(p,found->policy)==%d.  "
-              "tor_addr_compare(&p->addr, &found->policy->addr, CMP_EXACT)==%d",
-                 cmp_single_addr_policy(p,found->policy),
-                 tor_addr_compare(&p->addr, &found->policy->addr, CMP_EXACT));
-          }
           tor_assert(p == found->policy);
           tor_free(found);
         }



More information about the tor-commits mailing list