aboutsummaryrefslogtreecommitdiff
path: root/src/or/or.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/or.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/or.h')
-rw-r--r--src/or/or.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/or/or.h b/src/or/or.h
index 572dc8b96..cb2bbd75f 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -1453,6 +1453,9 @@ typedef struct {
* directory according to the authorities. */
unsigned int policy_is_reject_star:1; /**< True iff the exit policy for this
* router rejects everything. */
+ /** True if, after we have added this router, we should re-launch
+ * tests for it. */
+ unsigned int needs_retest_if_added:1;
/** Tor can use this router for general positions in circuits. */
#define ROUTER_PURPOSE_GENERAL 0