diff options
author | George Kadianakis <desnacked@riseup.net> | 2017-06-01 14:35:39 +0300 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2017-08-24 13:03:28 -0400 |
commit | 6eb9de1b8c2ede739ebcd3514201c07365fadb18 (patch) | |
tree | 85fc6933c2c2ae8957fd41b5d36fd19965320277 /src/or/directory.h | |
parent | 79ff2e014f5726648e3f2c4a3f521ede76b8c6e2 (diff) | |
download | tor-6eb9de1b8c2ede739ebcd3514201c07365fadb18.tar.gz tor-6eb9de1b8c2ede739ebcd3514201c07365fadb18.zip |
test: Add tests for fetching descs and handling SOCKS conns.
- Add tests that ensure that SOCKS requests for v2/v3 addresses get
intercepted and handled.
- Add test that stores and lookups an HS descriptor in the client-side cache.
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or/directory.h')
-rw-r--r-- | src/or/directory.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/or/directory.h b/src/or/directory.h index 92d9b266df..1acdff3460 100644 --- a/src/or/directory.h +++ b/src/or/directory.h @@ -168,6 +168,16 @@ int purpose_needs_anonymity(uint8_t dir_purpose, uint8_t router_purpose, #ifdef DIRECTORY_PRIVATE +/** A structure to hold arguments passed into each directory response + * handler */ +typedef struct response_handler_args_t { + int status_code; + const char *reason; + const char *body; + size_t body_len; + const char *headers; +} response_handler_args_t; + struct get_handler_args_t; STATIC int handle_get_hs_descriptor_v3(dir_connection_t *conn, const struct get_handler_args_t *args); @@ -183,7 +193,7 @@ STATIC int handle_response_fetch_hsdesc_v3(dir_connection_t *conn, #endif #ifdef TOR_UNIT_TESTS -/* Used only by test_dir.c */ +/* Used only by test_dir.c and test_hs_cache.c */ STATIC int parse_http_url(const char *headers, char **url); STATIC dirinfo_type_t dir_fetch_type(int dir_purpose, int router_purpose, |