[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] r11096: Save on most routerlist_assert_ok() calls in routerlist.c, t (in tor/branches/tor-0_1_2-patches: . src/or)
Author: weasel
Date: 2007-08-13 18:57:03 -0400 (Mon, 13 Aug 2007)
New Revision: 11096
Modified:
tor/branches/tor-0_1_2-patches/ChangeLog
tor/branches/tor-0_1_2-patches/src/or/routerlist.c
Log:
Save on most routerlist_assert_ok() calls in routerlist.c, thus greatly
speeding up loading cached-routers from disk on startup (backport from trunk).
Modified: tor/branches/tor-0_1_2-patches/ChangeLog
===================================================================
--- tor/branches/tor-0_1_2-patches/ChangeLog 2007-08-13 21:19:54 UTC (rev 11095)
+++ tor/branches/tor-0_1_2-patches/ChangeLog 2007-08-13 22:57:03 UTC (rev 11096)
@@ -1,3 +1,9 @@
+Changes in version 0.1.2.xx - 2007-xxxxx
+ o
+ - Save on most routerlist_assert_ok() calls in routerlist.c,
+ thus greatly speeding up loading cached-routers from disk on
+ startup (backport from trunk).
+
Changes in version 0.1.2.16 - 2007-08-01
o Major security fixes:
- Close immediately after missing authentication on control port;
Modified: tor/branches/tor-0_1_2-patches/src/or/routerlist.c
===================================================================
--- tor/branches/tor-0_1_2-patches/src/or/routerlist.c 2007-08-13 21:19:54 UTC (rev 11095)
+++ tor/branches/tor-0_1_2-patches/src/or/routerlist.c 2007-08-13 22:57:03 UTC (rev 11096)
@@ -15,6 +15,8 @@
#include "or.h"
+// #define DEBUG_ROUTERLIST
+
/****************************************************************************/
/* static function prototypes */
@@ -1612,7 +1614,9 @@
smartlist_add(rl->routers, ri);
ri->routerlist_index = smartlist_len(rl->routers) - 1;
router_dir_info_changed();
+#ifdef DEBUG_ROUTERLIST
routerlist_assert_ok(rl);
+#endif
}
/** If we're a directory cache and routerlist <b>rl</b> doesn't have
@@ -1635,7 +1639,9 @@
} else {
routerinfo_free(ri);
}
+#ifdef DEBUG_ROUTERLIST
routerlist_assert_ok(rl);
+#endif
}
/** Remove an item <b>ri</b> from the routerlist <b>rl</b>, updating indices
@@ -1672,7 +1678,9 @@
router_bytes_dropped += ri->cache_info.signed_descriptor_len;
routerinfo_free(ri);
}
+#ifdef DEBUG_ROUTERLIST
routerlist_assert_ok(rl);
+#endif
}
/** DOCDOC */
@@ -1689,7 +1697,9 @@
tor_assert(sd_tmp == sd);
router_bytes_dropped += sd->signed_descriptor_len;
signed_descriptor_free(sd);
+#ifdef DEBUG_ROUTERLIST
routerlist_assert_ok(rl);
+#endif
}
/** Remove <b>ri_old</b> from the routerlist <b>rl</b>, and replace it with
@@ -1746,7 +1756,9 @@
router_bytes_dropped += ri_old->cache_info.signed_descriptor_len;
routerinfo_free(ri_old);
}
+#ifdef DEBUG_ROUTERLIST
routerlist_assert_ok(rl);
+#endif
}
/** Free all memory held by the routerlist module. */