[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] Move directory_must_use_begindir() to dirclient_modes.[ch]



commit 8d1f31190e12d337ef37c5ba541b195d72dfd663
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Wed Jan 15 11:55:16 2020 -0500

    Move directory_must_use_begindir() to dirclient_modes.[ch]
---
 src/feature/dirclient/dirclient.c       | 10 ----------
 src/feature/dirclient/dirclient.h       |  2 --
 src/feature/dirclient/dirclient_modes.c | 10 ++++++++++
 src/feature/dirclient/dirclient_modes.h |  1 +
 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 200e4e6a1..2291bf730 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 7c2a539ef..08209721b 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 37d2d7e04..8a98f0276 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 ceb883038..f8ff74b6c 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 3da972fb8..8ca4fd5db 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"



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits