diff options
author | Nick Mathewson <nickm@torproject.org> | 2010-08-18 13:36:09 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2010-08-18 13:36:09 -0400 |
commit | 5926d9cfccccfca19895522ed7a445626be8cc79 (patch) | |
tree | d6fbbb0ecc5e632f38132543e38de4cf7a24c406 /src/or/dirserv.h | |
parent | 23fdf0b30fd9fdfe1f82e5aa1b8a196c3ca68575 (diff) | |
download | tor-5926d9cfccccfca19895522ed7a445626be8cc79.tar.gz tor-5926d9cfccccfca19895522ed7a445626be8cc79.zip |
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/dirserv.h')
-rw-r--r-- | src/or/dirserv.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/or/dirserv.h b/src/or/dirserv.h index fc5a5549c5..d80d6f693f 100644 --- a/src/or/dirserv.h +++ b/src/or/dirserv.h @@ -100,6 +100,8 @@ void dirserv_orconn_tls_done(const char *address, uint16_t or_port, const char *digest_rcvd, int as_advertised); +int dirserv_should_launch_reachability_test(routerinfo_t *ri, + routerinfo_t *ri_old); void dirserv_single_reachability_test(time_t now, routerinfo_t *router); void dirserv_test_reachability(time_t now); int authdir_wants_to_reject_router(routerinfo_t *ri, const char **msg, |