[or-cvs] r10445: Add some asserts to catch double-insert on routerlist. (in tor/trunk: . src/or)
nickm at seul.org
nickm at seul.org
Sat Jun 2 12:44:58 UTC 2007
Author: nickm
Date: 2007-06-02 08:44:57 -0400 (Sat, 02 Jun 2007)
New Revision: 10445
Modified:
tor/trunk/
tor/trunk/src/or/routerlist.c
Log:
r13144 at catbus: nickm | 2007-06-02 08:44:42 -0400
Add some asserts to catch double-insert on routerlist.
Property changes on: tor/trunk
___________________________________________________________________
svk:merge ticket from /tor/trunk [r13144] on 8246c3cf-6607-4228-993b-4d95d33730f1
Modified: tor/trunk/src/or/routerlist.c
===================================================================
--- tor/trunk/src/or/routerlist.c 2007-06-02 12:44:54 UTC (rev 10444)
+++ tor/trunk/src/or/routerlist.c 2007-06-02 12:44:57 UTC (rev 10445)
@@ -1893,6 +1893,7 @@
routerinfo_t *ri_generated = router_get_my_routerinfo();
tor_assert(ri_generated != ri);
}
+ tor_assert(ri->routerlist_index == -1);
ri_old = digestmap_set(rl->identity_map, ri->cache_info.identity_digest, ri);
tor_assert(!ri_old);
@@ -1981,6 +1982,8 @@
routerinfo_t *ri_generated = router_get_my_routerinfo();
tor_assert(ri_generated != ri);
}
+ tor_assert(ri->routerlist_index == -1);
+
if (get_options()->DirPort &&
ri->purpose == ROUTER_PURPOSE_GENERAL &&
!digestmap_get(rl->desc_digest_map,
@@ -2113,6 +2116,8 @@
tor_assert(ri_generated != ri_new);
}
tor_assert(ri_old != ri_new);
+ tor_assert(ri_new->routerlist_index == -1);
+
idx = _routerlist_find_elt(rl->routers, ri_old, idx);
router_dir_info_changed();
if (idx >= 0) {
More information about the tor-commits
mailing list