[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r10003: Even more asserts to try to catch bug 404/417. (in tor/trunk: . src/or)



Author: nickm
Date: 2007-04-22 20:24:06 -0400 (Sun, 22 Apr 2007)
New Revision: 10003

Modified:
   tor/trunk/
   tor/trunk/src/or/routerlist.c
Log:
 r12492@catbus:  nickm | 2007-04-22 20:24:02 -0400
 Even more asserts to try to catch bug 404/417.



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r12492] on 8246c3cf-6607-4228-993b-4d95d33730f1

Modified: tor/trunk/src/or/routerlist.c
===================================================================
--- tor/trunk/src/or/routerlist.c	2007-04-23 00:14:27 UTC (rev 10002)
+++ tor/trunk/src/or/routerlist.c	2007-04-23 00:24:06 UTC (rev 10003)
@@ -1757,6 +1757,7 @@
   // routerlist_assert_ok(rl);
 }
 
+/** DOCDOC */
 static void
 routerlist_remove_old(routerlist_t *rl, signed_descriptor_t *sd, int idx)
 {
@@ -2280,6 +2281,8 @@
   if (!routerlist || !networkstatus_list)
     return;
 
+  routerlist_assert_ok(routerlist);
+
   retain = digestmap_new();
   cutoff = now - OLD_ROUTER_DESC_MAX_AGE;
   /* Build a list of all the descriptors that _anybody_ recommends. */
@@ -2319,6 +2322,8 @@
     }
   }
 
+  routerlist_assert_ok(routerlist);
+
   /* Remove far-too-old members of routerlist->old_routers. */
   cutoff = now - OLD_ROUTER_DESC_MAX_AGE;
   for (i = 0; i < smartlist_len(routerlist->old_routers); ++i) {
@@ -2330,6 +2335,8 @@
     }
   }
 
+  routerlist_assert_ok(routerlist);
+
   /* Now we might have to look at routerlist->old_routers for extraneous
    * members. (We'd keep all the members if we could, but we need to save
    * space.) First, check whether we have too many router descriptors, total.