diff options
author | Nick Mathewson <nickm@torproject.org> | 2019-04-25 20:25:34 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2019-04-25 20:25:34 -0400 |
commit | efeb101b968fe6604ff97604afe527a36b94cfc9 (patch) | |
tree | 41085bd9b5bf159e0e3a6688ea1e0bacf527eb16 /src/feature/dirauth | |
parent | 36b4fc7437f22208838616495f699b793ca30771 (diff) | |
parent | cc87acf29b40a135745f74412caaececf8ea0329 (diff) | |
download | tor-efeb101b968fe6604ff97604afe527a36b94cfc9.tar.gz tor-efeb101b968fe6604ff97604afe527a36b94cfc9.zip |
Merge remote-tracking branch 'tor-github/pr/889'
Diffstat (limited to 'src/feature/dirauth')
-rw-r--r-- | src/feature/dirauth/voteflags.c | 18 | ||||
-rw-r--r-- | src/feature/dirauth/voteflags.h | 2 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/feature/dirauth/voteflags.c b/src/feature/dirauth/voteflags.c index 0a53c588d6..4040f162fa 100644 --- a/src/feature/dirauth/voteflags.c +++ b/src/feature/dirauth/voteflags.c @@ -29,6 +29,7 @@ #include "feature/nodelist/node_st.h" #include "feature/nodelist/routerinfo_st.h" +#include "feature/nodelist/routerlist_st.h" #include "feature/nodelist/vote_routerstatus_st.h" #include "lib/container/order.h" @@ -658,3 +659,20 @@ dirserv_set_routerstatus_testing(routerstatus_t *rs) rs->is_hs_dir = 0; } } + +/** Use dirserv_set_router_is_running() to set bridges as running if they're + * reachable. + * + * This function is called from set_bridge_running_callback() when running as + * a bridge authority. + */ +void +dirserv_set_bridges_running(time_t now) +{ + routerlist_t *rl = router_get_routerlist(); + + SMARTLIST_FOREACH_BEGIN(rl->routers, routerinfo_t *, ri) { + if (ri->purpose == ROUTER_PURPOSE_BRIDGE) + dirserv_set_router_is_running(ri, now); + } SMARTLIST_FOREACH_END(ri); +} diff --git a/src/feature/dirauth/voteflags.h b/src/feature/dirauth/voteflags.h index cca6f53746..18b29a5183 100644 --- a/src/feature/dirauth/voteflags.h +++ b/src/feature/dirauth/voteflags.h @@ -25,6 +25,8 @@ void set_routerstatus_from_routerinfo(routerstatus_t *rs, void dirserv_compute_performance_thresholds(digestmap_t *omit_as_sybil); +void dirserv_set_bridges_running(time_t now); + #ifdef VOTEFLAGS_PRIVATE /** Any descriptor older than this age causes the authorities to set the * StaleDesc flag. */ |