aboutsummaryrefslogtreecommitdiff
path: root/src/or/routerlist.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2010-08-18 13:36:09 -0400
committerNick Mathewson <nickm@torproject.org>2010-08-18 13:36:09 -0400
commit5926d9cfccccfca19895522ed7a445626be8cc79 (patch)
treed6fbbb0ecc5e632f38132543e38de4cf7a24c406 /src/or/routerlist.h
parent23fdf0b30fd9fdfe1f82e5aa1b8a196c3ca68575 (diff)
downloadtor-5926d9cfccccfca19895522ed7a445626be8cc79.tar
tor-5926d9cfccccfca19895522ed7a445626be8cc79.tar.gz
Move code for launching tests out of router_add_to_routerlist()
router_add_to_routerlist() is supposed to be a nice minimal function that only touches the routerlist structures, but it included a call to dirserv_single_reachability_test(). We have a function that gets called _after_ adding descriptors successfully: routerlist_descriptors_added. This patch moves the responsibility for testing there. Because the decision of whether to test or not depends on whether there was an old routerinfo for this router or not, we have to first detect whether we _will_ want to run the tests if the router is added. We make this the job of routers_update_status_from_consensus_networkstatus(). Finally, this patch makes the code notice if a router is going from hibernating to non-hibernating, and if so causes a reachability test to get launched.
Diffstat (limited to 'src/or/routerlist.h')
-rw-r--r--src/or/routerlist.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/or/routerlist.h b/src/or/routerlist.h
index e31b07aef..d71a737b8 100644
--- a/src/or/routerlist.h
+++ b/src/or/routerlist.h
@@ -115,6 +115,7 @@ was_router_added_t router_add_to_routerlist(routerinfo_t *router,
was_router_added_t router_add_extrainfo_to_routerlist(
extrainfo_t *ei, const char **msg,
int from_cache, int from_fetch);
+void routerlist_descriptors_added(smartlist_t *sl, int from_cache);
void routerlist_remove_old_routers(void);
int router_load_single_router(const char *s, uint8_t purpose, int cache,
const char **msg);