diff options
author | Arlo Breault <arlolra@gmail.com> | 2014-09-23 12:12:57 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-09-23 12:12:57 -0400 |
commit | c00b397992edefb4507f2c1408e289243f5c7916 (patch) | |
tree | fe65696d520fb7e5cd423e96d9f5a523b278acef /src/or/directory.h | |
parent | 2e168566654957cb708d7484c28778e110384ae4 (diff) | |
download | tor-c00b397992edefb4507f2c1408e289243f5c7916.tar.gz tor-c00b397992edefb4507f2c1408e289243f5c7916.zip |
Split dirinfo_type_t computation into a new function
Diffstat (limited to 'src/or/directory.h')
-rw-r--r-- | src/or/directory.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/or/directory.h b/src/or/directory.h index bc200797d4..b19358f3e7 100644 --- a/src/or/directory.h +++ b/src/or/directory.h @@ -16,9 +16,10 @@ int directories_have_accepted_server_descriptor(void); void directory_post_to_dirservers(uint8_t dir_purpose, uint8_t router_purpose, dirinfo_type_t type, const char *payload, size_t payload_len, size_t extrainfo_len); -void directory_get_from_dirserver(uint8_t dir_purpose, uint8_t router_purpose, - const char *resource, - int pds_flags); +MOCK_DECL(void, directory_get_from_dirserver, (uint8_t dir_purpose, + uint8_t router_purpose, + const char *resource, + int pds_flags)); void directory_get_from_all_authorities(uint8_t dir_purpose, uint8_t router_purpose, const char *resource); @@ -120,7 +121,11 @@ int download_status_get_n_failures(const download_status_t *dls); #ifdef TOR_UNIT_TESTS /* Used only by directory.c and test_dir.c */ + STATIC int parse_http_url(const char *headers, char **url); +STATIC int purpose_needs_anonymity(uint8_t dir_purpose, uint8_t router_purpose); +STATIC dirinfo_type_t dir_fetch_type(int dir_purpose, int router_purpose, + const char *resource); #endif #endif |