diff options
Diffstat (limited to 'src/feature/dirclient')
-rw-r--r-- | src/feature/dirclient/dirclient.c | 12 | ||||
-rw-r--r-- | src/feature/dirclient/dirclient_modes.c | 12 | ||||
-rw-r--r-- | src/feature/dirclient/dirclient_modes.h | 10 |
3 files changed, 17 insertions, 17 deletions
diff --git a/src/feature/dirclient/dirclient.c b/src/feature/dirclient/dirclient.c index 2291bf730c..1b6eed12f0 100644 --- a/src/feature/dirclient/dirclient.c +++ b/src/feature/dirclient/dirclient.c @@ -454,7 +454,7 @@ directory_get_from_dirserver,( { const routerstatus_t *rs = NULL; const or_options_t *options = get_options(); - int prefer_authority = (directory_fetches_from_authorities(options) + int prefer_authority = (dirclient_fetches_from_authorities(options) || want_authority == DL_WANT_AUTHORITY); int require_authority = 0; int get_via_tor = purpose_needs_anonymity(dir_purpose, router_purpose, @@ -673,7 +673,7 @@ directory_choose_address_routerstatus(const routerstatus_t *status, if (indirection == DIRIND_DIRECT_CONN || indirection == DIRIND_ANON_DIRPORT || (indirection == DIRIND_ONEHOP - && !directory_must_use_begindir(options))) { + && !dirclient_must_use_begindir(options))) { fascist_firewall_choose_address_rs(status, FIREWALL_DIR_CONNECTION, 0, use_dir_ap); have_dir = tor_addr_port_is_valid_ap(use_dir_ap, 0); @@ -923,7 +923,7 @@ directory_command_should_use_begindir(const or_options_t *options, } /* Reasons why we want to avoid using begindir */ if (indirection == DIRIND_ONEHOP) { - if (!directory_must_use_begindir(options)) { + if (!dirclient_must_use_begindir(options)) { *reason = "in relay mode"; return 0; } @@ -1285,7 +1285,7 @@ directory_initiate_request,(directory_request_t *request)) /* use encrypted begindir connections for everything except relays * this provides better protection for directory fetches */ - if (!use_begindir && directory_must_use_begindir(options)) { + if (!use_begindir && dirclient_must_use_begindir(options)) { log_warn(LD_BUG, "Client could not use begindir connection: %s", begindir_reason ? begindir_reason : "(NULL)"); return; @@ -3084,7 +3084,7 @@ dir_routerdesc_download_failed(smartlist_t *failed, int status_code, { char digest[DIGEST_LEN]; time_t now = time(NULL); - int server = directory_fetches_from_authorities(get_options()); + int server = dirclient_fetches_from_authorities(get_options()); if (!was_descriptor_digests) { if (router_purpose == ROUTER_PURPOSE_BRIDGE) { tor_assert(!was_extrainfo); @@ -3129,7 +3129,7 @@ dir_microdesc_download_failed(smartlist_t *failed, routerstatus_t *rs; download_status_t *dls; time_t now = time(NULL); - int server = directory_fetches_from_authorities(get_options()); + int server = dirclient_fetches_from_authorities(get_options()); if (! consensus) return; diff --git a/src/feature/dirclient/dirclient_modes.c b/src/feature/dirclient/dirclient_modes.c index 8a98f02769..23fd1a2f6e 100644 --- a/src/feature/dirclient/dirclient_modes.c +++ b/src/feature/dirclient/dirclient_modes.c @@ -26,7 +26,7 @@ /* Should this tor instance only use begindir for all its directory requests? */ int -directory_must_use_begindir(const or_options_t *options) +dirclient_must_use_begindir(const or_options_t *options) { /* Clients, onion services, and bridges must use begindir, * relays and authorities do not have to */ @@ -36,7 +36,7 @@ directory_must_use_begindir(const or_options_t *options) /** Return 1 if we fetch our directory material directly from the * authorities, rather than from a mirror. */ int -directory_fetches_from_authorities(const or_options_t *options) +dirclient_fetches_from_authorities(const or_options_t *options) { const routerinfo_t *me; uint32_t addr; @@ -64,9 +64,9 @@ directory_fetches_from_authorities(const or_options_t *options) * on the "mirror" schedule rather than the "client" schedule. */ int -directory_fetches_dir_info_early(const or_options_t *options) +dirclient_fetches_dir_info_early(const or_options_t *options) { - return directory_fetches_from_authorities(options); + return dirclient_fetches_from_authorities(options); } /** Return 1 if we should fetch new networkstatuses, descriptors, etc @@ -76,7 +76,7 @@ directory_fetches_dir_info_early(const or_options_t *options) * client as a directory guard. */ int -directory_fetches_dir_info_later(const or_options_t *options) +dirclient_fetches_dir_info_later(const or_options_t *options) { return options->UseBridges != 0; } @@ -86,7 +86,7 @@ directory_fetches_dir_info_later(const or_options_t *options) * lately. */ int -directory_too_idle_to_fetch_descriptors(const or_options_t *options, +dirclient_too_idle_to_fetch_descriptors(const or_options_t *options, time_t now) { return !directory_caches_dir_info(options) && diff --git a/src/feature/dirclient/dirclient_modes.h b/src/feature/dirclient/dirclient_modes.h index f8ff74b6c1..c402207724 100644 --- a/src/feature/dirclient/dirclient_modes.h +++ b/src/feature/dirclient/dirclient_modes.h @@ -14,11 +14,11 @@ 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); -int directory_too_idle_to_fetch_descriptors(const struct or_options_t *options, +int dirclient_must_use_begindir(const or_options_t *options); +int dirclient_fetches_from_authorities(const struct or_options_t *options); +int dirclient_fetches_dir_info_early(const struct or_options_t *options); +int dirclient_fetches_dir_info_later(const struct or_options_t *options); +int dirclient_too_idle_to_fetch_descriptors(const struct or_options_t *options, time_t now); #endif /* !defined(TOR_FEATURE_DIRCLIENT_DIRCLIENT_MODES_H) */ |