[or-cvs] r11161: Remove routerlist_check_bug_417() and all its calls. There i (tor/trunk/src/or)

weasel at seul.org weasel at seul.org
Fri Aug 17 22:55:05 UTC 2007


Author: weasel
Date: 2007-08-17 18:55:04 -0400 (Fri, 17 Aug 2007)
New Revision: 11161

Modified:
   tor/trunk/src/or/routerlist.c
Log:
Remove routerlist_check_bug_417() and all its calls.  There is still some more debugging code left, marked with XXXs

Modified: tor/trunk/src/or/routerlist.c
===================================================================
--- tor/trunk/src/or/routerlist.c	2007-08-17 22:43:00 UTC (rev 11160)
+++ tor/trunk/src/or/routerlist.c	2007-08-17 22:55:04 UTC (rev 11161)
@@ -143,8 +143,6 @@
   if (!networkstatus_list)
     networkstatus_list = smartlist_create();
 
-  routerlist_check_bug_417();
-
   tor_snprintf(filename,sizeof(filename),"%s"PATH_SEPARATOR"cached-status",
                get_options()->DataDirectory);
   entries = tor_listdir(filename);
@@ -171,7 +169,6 @@
   smartlist_free(entries);
   networkstatus_list_clean(time(NULL));
   routers_update_all_from_networkstatus(time(NULL));
-  routerlist_check_bug_417();
   return 0;
 }
 
@@ -449,8 +446,6 @@
     "cached-routers" : "cached-extrainfo";
   store_stats_t *stats;
 
-  routerlist_check_bug_417();
-
   if (purpose == ROUTER_PURPOSE_GENERAL) {
     stats = &router_store_stats;
   } else if (purpose == EXTRAINFO_PURPOSE_GENERAL) {
@@ -477,7 +472,6 @@
   desc->saved_offset = stats->journal_len;
   stats->journal_len += len;
 
-  routerlist_check_bug_417();
   return 0;
 }
 
@@ -522,7 +516,6 @@
   mmap_ptr =
     extrainfo ? &routerlist->mmap_extrainfo : &routerlist->mmap_descriptors;
 
-  routerlist_check_bug_417();
   routerlist_assert_ok(routerlist);
 
   /* Don't save deadweight. */
@@ -632,7 +625,6 @@
   SMARTLIST_FOREACH(chunk_list, sized_chunk_t *, c, tor_free(c));
   smartlist_free(chunk_list);
 
-  routerlist_check_bug_417();
   return r;
 }
 
@@ -652,8 +644,6 @@
   tor_mmap_t **mmap_ptr;
   struct stat st;
 
-  routerlist_check_bug_417();
-
   if (!routerlist)
     router_get_routerlist(); /* mallocs and inits it in place */
 
@@ -708,8 +698,6 @@
     routerlist_remove_old_routers();
   }
 
-  routerlist_check_bug_417();
-
   return 0;
 }
 
@@ -1897,7 +1885,7 @@
   }
   addr_policy_free(router->exit_policy);
 
-  /* Remove once 414/417 is fixed. But I have a hunch... */
+  /* XXXX020 Remove once 414/417 is fixed. But I have a hunch... */
   memset(router, 77, sizeof(routerinfo_t));
 
   tor_free(router);
@@ -2038,7 +2026,6 @@
 routerlist_insert(routerlist_t *rl, routerinfo_t *ri)
 {
   routerinfo_t *ri_old;
-  routerlist_check_bug_417();
   {
     /* XXXX020 remove this code once bug 417/404 is fixed. */
     routerinfo_t *ri_generated = router_get_my_routerinfo();
@@ -2056,7 +2043,6 @@
   smartlist_add(rl->routers, ri);
   ri->routerlist_index = smartlist_len(rl->routers) - 1;
   router_dir_info_changed();
-  routerlist_check_bug_417();
 #ifdef DEBUG_ROUTERLIST
   routerlist_assert_ok(rl);
 #endif
@@ -2073,7 +2059,6 @@
                                ei->cache_info.identity_digest);
   signed_descriptor_t *sd;
   extrainfo_t *ei_tmp;
-  routerlist_check_bug_417();
 
   {
     /* XXXX020 remove this code once bug 417/404 is fixed. */
@@ -2114,7 +2099,6 @@
   if (r == 0)
     extrainfo_free(ei);
 
-  routerlist_check_bug_417();
 #ifdef DEBUG_ROUTERLIST
   routerlist_assert_ok(rl);
 #endif
@@ -2127,7 +2111,6 @@
 static void
 routerlist_insert_old(routerlist_t *rl, routerinfo_t *ri)
 {
-  routerlist_check_bug_417();
   {
     /* XXXX020 remove this code once bug 417/404 is fixed. */
     routerinfo_t *ri_generated = router_get_my_routerinfo();
@@ -2147,7 +2130,6 @@
   } else {
     routerinfo_free(ri);
   }
-  routerlist_check_bug_417();
 #ifdef DEBUG_ROUTERLIST
   routerlist_assert_ok(rl);
 #endif
@@ -2170,7 +2152,6 @@
   tor_assert(0 <= idx && idx < smartlist_len(rl->routers));
   tor_assert(smartlist_get(rl->routers, idx) == ri);
 
-  routerlist_check_bug_417();
   ri->routerlist_index = -1;
   smartlist_del(rl->routers, idx);
   if (idx < smartlist_len(rl->routers)) {
@@ -2207,7 +2188,6 @@
       sdmap_remove(rl->desc_by_eid_map, ri->cache_info.extra_info_digest);
     routerinfo_free(ri);
   }
-  routerlist_check_bug_417();
 #ifdef DEBUG_ROUTERLIST
   routerlist_assert_ok(rl);
 #endif
@@ -2221,7 +2201,6 @@
 {
   signed_descriptor_t *sd_tmp;
   extrainfo_t *ei_tmp;
-  routerlist_check_bug_417();
   tor_assert(0 <= idx && idx < smartlist_len(rl->old_routers));
   tor_assert(smartlist_get(rl->old_routers, idx) == sd);
 
@@ -2242,7 +2221,6 @@
     sdmap_remove(rl->desc_by_eid_map, sd->extra_info_digest);
 
   signed_descriptor_free(sd);
-  routerlist_check_bug_417();
 #ifdef DEBUG_ROUTERLIST
   routerlist_assert_ok(rl);
 #endif
@@ -2264,7 +2242,6 @@
 
   routerinfo_t *ri_tmp;
   extrainfo_t *ei_tmp;
-  routerlist_check_bug_417();
   {
     /* XXXX020 remove this code once bug 417/404 is fixed. */
     routerinfo_t *ri_generated = router_get_my_routerinfo();
@@ -2337,7 +2314,6 @@
       ri_old->cache_info.signed_descriptor_len;
     routerinfo_free(ri_old);
   }
-  routerlist_check_bug_417();
 #ifdef DEBUG_ROUTERLIST
   routerlist_assert_ok(rl);
 #endif
@@ -2453,7 +2429,6 @@
   local_routerstatus_t *status;
   tor_assert(digest);
 
-  routerlist_check_bug_417();
   SMARTLIST_FOREACH(trusted_dir_servers, trusted_dir_server_t *, d,
                     if (!memcmp(d->digest, digest, DIGEST_LEN))
                       d->is_running = up);
@@ -2473,7 +2448,6 @@
     control_event_networkstatus_changed_single(status);
   }
   router_dir_info_changed();
-  routerlist_check_bug_417();
 }
 
 /** Add <b>router</b> to the routerlist, if we don't already have it.  Replace
@@ -2518,7 +2492,6 @@
     authdir && !from_cache && !from_fetch &&
     router_have_minimum_dir_info();
 
-  routerlist_check_bug_417();
   tor_assert(msg);
 
   if (!routerlist)
@@ -2929,7 +2902,6 @@
   tor_assert(msg);
   *msg = NULL;
 
-  routerlist_check_bug_417();
   if (!(ri = router_parse_entry_from_string(s, NULL, 1))) {
     log_warn(LD_DIR, "Error parsing router descriptor; dropping.");
     *msg = "Couldn't parse router descriptor.";
@@ -5540,41 +5512,6 @@
   }
 }
 
-/** Debugging function.  With any luck, we can remove this soon.  Fail with an
- * assertion if the symptoms for bug 417/404 seem to be present. */
-void
-routerlist_check_bug_417(void)
-{
-  /* XXXX020 remove this function once bug 417/404 is fixed. */
-  routerlist_t *rl = router_get_routerlist();
-  routerinfo_t *ri_generated, *r2, *r;
-  int idx = -1;
-
-  ri_generated = router_get_my_routerinfo();
-  if (!ri_generated)
-    return;
-
-  r = rimap_get(rl->identity_map,
-                ri_generated->cache_info.identity_digest);
-  if (r) {
-    idx = r->routerlist_index;
-    tor_assert(idx >= 0);
-    tor_assert(idx < smartlist_len(rl->routers));
-    r2 = smartlist_get(rl->routers, idx);
-    tor_assert(r == r2);
-  } else {
-#if 0
-    /* Too slow; the bug seems to be in the former case anyway. */
-    SMARTLIST_FROEACH(rl->routers, routerinfo_t *, ri,
-      {
-        tor_assert(!router_is_me(ri));
-      });
-#endif
-  }
-
-  tor_assert(ri_generated->routerlist_index == -1);
-}
-
 /** Allocate and return a new string representing the contact info
  * and platform string for <b>router</b>,
  * surrounded by quotes and using standard C escapes.



More information about the tor-commits mailing list