]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Add a new net_is_completely_disabled() function
authorNick Mathewson <nickm@torproject.org>
Wed, 9 May 2018 16:21:08 +0000 (12:21 -0400)
committerNick Mathewson <nickm@torproject.org>
Wed, 9 May 2018 16:21:08 +0000 (12:21 -0400)
src/or/router.c
src/or/router.h

index 71b292a67b84fb4e0335aaf47940e6fb962ec72f..07abf1f8d5e1ec52e09e1eb4dc39c9717eabe2a1 100644 (file)
@@ -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.
  */
index 03eca9c65d316b2bf5e3aeecc591f7999bdeafa8..0db2c1cfb213e5016ee12b256ec05de3b95816a7 100644 (file)
@@ -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);