mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-27 22:03:31 +01:00
Move directory_must_use_begindir() to dirclient_modes.[ch]
This commit is contained in:
parent
773bcf5629
commit
8d1f31190e
@ -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.
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user