summaryrefslogtreecommitdiff
path: root/src/or/directory.c
diff options
context:
space:
mode:
authorteor (Tim Wilson-Brown) <teor2345@gmail.com>2015-12-07 17:47:10 +1100
committerteor (Tim Wilson-Brown) <teor2345@gmail.com>2015-12-16 04:03:45 +1100
commitd3546aa92bf5c7c1435381b33a42f2a4a3d3c2f5 (patch)
treee4f8998e714512b00925d2cbc013e370908cb94d /src/or/directory.c
parentdf0c135d62ab1619843f7825ccd5ad697f6afdcb (diff)
downloadtor-d3546aa92bf5c7c1435381b33a42f2a4a3d3c2f5.tar.gz
tor-d3546aa92bf5c7c1435381b33a42f2a4a3d3c2f5.zip
Prop210: Add want_authority to directory_get_from_dirserver
Diffstat (limited to 'src/or/directory.c')
-rw-r--r--src/or/directory.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/or/directory.c b/src/or/directory.c
index 4e5644b854..555462b325 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -425,14 +425,17 @@ directory_pick_generic_dirserver(dirinfo_type_t type, int pds_flags,
* Use <b>pds_flags</b> as arguments to router_pick_directory_server()
* or router_pick_trusteddirserver().
*/
-MOCK_IMPL(void, directory_get_from_dirserver, (uint8_t dir_purpose,
- uint8_t router_purpose,
- const char *resource,
- int pds_flags))
+MOCK_IMPL(void, directory_get_from_dirserver, (
+ uint8_t dir_purpose,
+ uint8_t router_purpose,
+ const char *resource,
+ int pds_flags,
+ download_want_authority_t want_authority))
{
const routerstatus_t *rs = NULL;
const or_options_t *options = get_options();
- int prefer_authority = directory_fetches_from_authorities(options);
+ int prefer_authority = (directory_fetches_from_authorities(options)
+ || want_authority == DL_WANT_AUTHORITY);
int require_authority = 0;
int get_via_tor = purpose_needs_anonymity(dir_purpose, router_purpose);
dirinfo_type_t type = dir_fetch_type(dir_purpose, router_purpose, resource);