diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-05-09 12:21:08 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-05-09 12:21:08 -0400 |
commit | 7595eae52ace0d2e0110e3d0471d4a5ca0c99ce9 (patch) | |
tree | 328fca7ee16139b6216384781e1cb9b85bc43895 /src | |
parent | c0feb698a0ab8574019d23cbd3060eb0513489c4 (diff) | |
download | tor-7595eae52ace0d2e0110e3d0471d4a5ca0c99ce9.tar.gz tor-7595eae52ace0d2e0110e3d0471d4a5ca0c99ce9.zip |
Add a new net_is_completely_disabled() function
Diffstat (limited to 'src')
-rw-r--r-- | src/or/router.c | 15 | ||||
-rw-r--r-- | src/or/router.h | 1 |
2 files changed, 13 insertions, 3 deletions
diff --git a/src/or/router.c b/src/or/router.c index 71b292a67b..07abf1f8d5 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -1599,15 +1599,24 @@ router_perform_bandwidth_test(int num_circs, time_t now) } } -/** Return true iff our network is in some sense disabled: either we're - * hibernating, entering hibernation, or the network is turned off with - * DisableNetwork. */ +/** Return true iff our network is in some sense disabled or shutting down: + * either we're hibernating, entering hibernation, or the network is turned + * off with DisableNetwork. */ int net_is_disabled(void) { return get_options()->DisableNetwork || we_are_hibernating(); } +/** Return true iff our network is in some sense "completely disabled" either + * we're fully hibernating or the network is turned off with + * DisableNetwork. */ +int +net_is_completely_disabled(void) +{ + return get_options()->DisableNetwork || we_are_fully_hibernating(); +} + /** Return true iff we believe ourselves to be an authoritative * directory server. */ diff --git a/src/or/router.h b/src/or/router.h index 03eca9c65d..0db2c1cfb2 100644 --- a/src/or/router.h +++ b/src/or/router.h @@ -53,6 +53,7 @@ void router_dirport_found_reachable(void); void router_perform_bandwidth_test(int num_circs, time_t now); int net_is_disabled(void); +int net_is_completely_disabled(void); int authdir_mode(const or_options_t *options); int authdir_mode_handles_descs(const or_options_t *options, int purpose); |