summaryrefslogtreecommitdiff
path: root/src/or/routerlist.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2010-09-14 22:19:22 -0400
committerNick Mathewson <nickm@torproject.org>2010-09-14 22:19:22 -0400
commite2b71d884139af902fc9b9222f5b55fe5a7a91ec (patch)
treef56bfffb62b21fa9dae69d1ebd4dd8bb509c4f8c /src/or/routerlist.c
parenta445daf0cf7e7828aefacae1a11df5e76efacafa (diff)
parentd9e05505606046afa8b346acac5f1e379e6f6e6d (diff)
downloadtor-e2b71d884139af902fc9b9222f5b55fe5a7a91ec.tar.gz
tor-e2b71d884139af902fc9b9222f5b55fe5a7a91ec.zip
Merge branch 'bug911'
Diffstat (limited to 'src/or/routerlist.c')
-rw-r--r--src/or/routerlist.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index ca16456a8c..402e98599e 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -3300,11 +3300,6 @@ router_add_to_routerlist(routerinfo_t *router, const char **msg,
* the list. */
routerlist_insert(routerlist, router);
if (!from_cache) {
- if (authdir) {
- /* launch an immediate reachability test, so we will have an opinion
- * soon in case we're generating a consensus soon */
- dirserv_single_reachability_test(time(NULL), router);
- }
signed_desc_append_to_journal(&router->cache_info,
&routerlist->desc_store);
}
@@ -3624,15 +3619,19 @@ routerlist_remove_old_routers(void)
/** We just added a new set of descriptors. Take whatever extra steps
* we need. */
-static void
+void
routerlist_descriptors_added(smartlist_t *sl, int from_cache)
{
tor_assert(sl);
control_event_descriptors_changed(sl);
- SMARTLIST_FOREACH(sl, routerinfo_t *, ri,
+ SMARTLIST_FOREACH_BEGIN(sl, routerinfo_t *, ri) {
if (ri->purpose == ROUTER_PURPOSE_BRIDGE)
learned_bridge_descriptor(ri, from_cache);
- );
+ if (ri->needs_retest_if_added) {
+ ri->needs_retest_if_added = 0;
+ dirserv_single_reachability_test(approx_time(), ri);
+ }
+ } SMARTLIST_FOREACH_END(ri);
}
/**