diff options
author | Nick Mathewson <nickm@torproject.org> | 2020-01-15 11:55:16 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2020-01-16 07:48:17 -0500 |
commit | 8d1f31190e12d337ef37c5ba541b195d72dfd663 (patch) | |
tree | 2bf0743900e50a3d128a65f8880fd140a4e14c4e | |
parent | 773bcf56290674cdc157f6e39894d31b366f8c50 (diff) | |
download | tor-8d1f31190e12d337ef37c5ba541b195d72dfd663.tar.gz tor-8d1f31190e12d337ef37c5ba541b195d72dfd663.zip |
Move directory_must_use_begindir() to dirclient_modes.[ch]
-rw-r--r-- | src/feature/dirclient/dirclient.c | 10 | ||||
-rw-r--r-- | src/feature/dirclient/dirclient.h | 2 | ||||
-rw-r--r-- | src/feature/dirclient/dirclient_modes.c | 10 | ||||
-rw-r--r-- | src/feature/dirclient/dirclient_modes.h | 1 | ||||
-rw-r--r-- | src/feature/nodelist/node_select.c | 1 |
5 files changed, 12 insertions, 12 deletions
diff --git a/src/feature/dirclient/dirclient.c b/src/feature/dirclient/dirclient.c index 200e4e6a15..2291bf730c 100644 --- a/src/feature/dirclient/dirclient.c +++ b/src/feature/dirclient/dirclient.c @@ -872,16 +872,6 @@ connection_dir_download_cert_failed(dir_connection_t *conn, int status) update_certificate_downloads(time(NULL)); } -/* Should this tor instance only use begindir for all its directory requests? - */ -int -directory_must_use_begindir(const or_options_t *options) -{ - /* Clients, onion services, and bridges must use begindir, - * relays and authorities do not have to */ - return !public_server_mode(options); -} - /** Evaluate the situation and decide if we should use an encrypted * "begindir-style" connection for this directory request. * 0) If there is no DirPort, yes. diff --git a/src/feature/dirclient/dirclient.h b/src/feature/dirclient/dirclient.h index 7c2a539ef7..08209721bb 100644 --- a/src/feature/dirclient/dirclient.h +++ b/src/feature/dirclient/dirclient.h @@ -41,8 +41,6 @@ typedef enum { DIRIND_ANON_DIRPORT, } dir_indirection_t; -int directory_must_use_begindir(const or_options_t *options); - /** * A directory_request_t describes the information about a directory request * at the client side. It describes what we're going to ask for, which diff --git a/src/feature/dirclient/dirclient_modes.c b/src/feature/dirclient/dirclient_modes.c index 37d2d7e044..8a98f02769 100644 --- a/src/feature/dirclient/dirclient_modes.c +++ b/src/feature/dirclient/dirclient_modes.c @@ -23,6 +23,16 @@ #include "app/config/or_options_st.h" #include "feature/nodelist/routerinfo_st.h" +/* Should this tor instance only use begindir for all its directory requests? + */ +int +directory_must_use_begindir(const or_options_t *options) +{ + /* Clients, onion services, and bridges must use begindir, + * relays and authorities do not have to */ + return !public_server_mode(options); +} + /** Return 1 if we fetch our directory material directly from the * authorities, rather than from a mirror. */ int diff --git a/src/feature/dirclient/dirclient_modes.h b/src/feature/dirclient/dirclient_modes.h index ceb883038c..f8ff74b6c1 100644 --- a/src/feature/dirclient/dirclient_modes.h +++ b/src/feature/dirclient/dirclient_modes.h @@ -14,6 +14,7 @@ struct or_options_t; +int directory_must_use_begindir(const or_options_t *options); int directory_fetches_from_authorities(const struct or_options_t *options); int directory_fetches_dir_info_early(const struct or_options_t *options); int directory_fetches_dir_info_later(const struct or_options_t *options); diff --git a/src/feature/nodelist/node_select.c b/src/feature/nodelist/node_select.c index 3da972fb8c..8ca4fd5dba 100644 --- a/src/feature/nodelist/node_select.c +++ b/src/feature/nodelist/node_select.c @@ -19,6 +19,7 @@ #include "core/or/reasons.h" #include "feature/client/entrynodes.h" #include "feature/dirclient/dirclient.h" +#include "feature/dirclient/dirclient_modes.h" #include "feature/dircommon/directory.h" #include "feature/nodelist/describe.h" #include "feature/nodelist/dirlist.h" |