diff options
author | David Goulet <dgoulet@torproject.org> | 2018-04-25 13:41:04 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2018-05-09 12:36:39 -0400 |
commit | 01ffe8e2f4ca24325e81f040e1ac3a5a17afa5d5 (patch) | |
tree | e8530bb79ad45911e2a898d6a7a8f5fc98c940d8 /src/or/networkstatus.c | |
parent | 61d5ce83a1ecc459798b530730316bfebe3bb192 (diff) | |
download | tor-01ffe8e2f4ca24325e81f040e1ac3a5a17afa5d5.tar.gz tor-01ffe8e2f4ca24325e81f040e1ac3a5a17afa5d5.zip |
config: Move any_client_port_set() to config.c
This functions is now used outside of networkstatus.c and makes more sense to
be in config.c.
It is also renamed to options_any_client_port_set() for the config.c
namespace.
No code behavior change.
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or/networkstatus.c')
-rw-r--r-- | src/or/networkstatus.c | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c index 44c0638c2b..b7443b4c7a 100644 --- a/src/or/networkstatus.c +++ b/src/or/networkstatus.c @@ -1691,24 +1691,6 @@ networkstatus_set_current_consensus_from_ns(networkstatus_t *c, #endif /* defined(TOR_UNIT_TESTS) */ /** - * Return true if any option is set in <b>options</b> to make us behave - * as a client. - * - * XXXX If we need this elsewhere at any point, we should make it nonstatic - * XXXX and move it into another file. - */ -int -any_client_port_set(const or_options_t *options) -{ - return (options->SocksPort_set || - options->TransPort_set || - options->NATDPort_set || - options->ControlPort_set || - options->DNSPort_set || - options->HTTPTunnelPort_set); -} - -/** * Helper for handle_missing_protocol_warning: handles either the * client case (if <b>is_client</b> is set) or the server case otherwise. */ @@ -1743,7 +1725,7 @@ handle_missing_protocol_warning(const networkstatus_t *c, const or_options_t *options) { const int is_server = server_mode(options); - const int is_client = any_client_port_set(options) || !is_server; + const int is_client = options_any_client_port_set(options) || !is_server; if (is_server) handle_missing_protocol_warning_impl(c, 0); |