summaryrefslogtreecommitdiff
path: root/src/or/routerlist.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-04-23 00:24:06 +0000
committerNick Mathewson <nickm@torproject.org>2007-04-23 00:24:06 +0000
commit5cf600b57a138c70d7900a6259a27b9b2f8fc771 (patch)
tree85324e4cecc9d6e147339987863e9f6f928208e7 /src/or/routerlist.c
parentc148dc7eb48d9d3962fd0c5a564ae60706e98c29 (diff)
downloadtor-5cf600b57a138c70d7900a6259a27b9b2f8fc771.tar.gz
tor-5cf600b57a138c70d7900a6259a27b9b2f8fc771.zip
r12492@catbus: nickm | 2007-04-22 20:24:02 -0400
Even more asserts to try to catch bug 404/417. svn:r10003
Diffstat (limited to 'src/or/routerlist.c')
-rw-r--r--src/or/routerlist.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 0f98b3d3a4..b1efe89eaf 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -1757,6 +1757,7 @@ routerlist_remove(routerlist_t *rl, routerinfo_t *ri, int idx, int make_old)
// routerlist_assert_ok(rl);
}
+/** DOCDOC */
static void
routerlist_remove_old(routerlist_t *rl, signed_descriptor_t *sd, int idx)
{
@@ -2280,6 +2281,8 @@ routerlist_remove_old_routers(void)
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_remove_old_routers(void)
}
}
+ 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_remove_old_routers(void)
}
}
+ 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.