diff options
author | David Goulet <dgoulet@torproject.org> | 2017-08-09 11:45:29 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2017-08-24 13:03:28 -0400 |
commit | 31da3898e72cc2b9e8c25f6b4e89d34bbb17737e (patch) | |
tree | 80740cc40be9344d8f202a494038d5192c0736dc /src/or/directory.c | |
parent | a64ef7d6c5f609229c4e6a25f1b18494a3ba6eea (diff) | |
download | tor-31da3898e72cc2b9e8c25f6b4e89d34bbb17737e.tar.gz tor-31da3898e72cc2b9e8c25f6b4e89d34bbb17737e.zip |
prop224: Add directory_request_fetch_set_hs_ident()
Needed by the client when fetching a descriptor. This function checks the
directory purpose and hard assert if it is not for fetching.
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or/directory.c')
-rw-r--r-- | src/or/directory.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/or/directory.c b/src/or/directory.c index f3e76be62f..57dfdd9cac 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -1292,6 +1292,20 @@ directory_request_upload_set_hs_ident(directory_request_t *req, } req->hs_ident = ident; } +/** + * Set an object containing HS connection identifier to be associated with + * this fetch request. Note that only an alias to <b>ident</b> is stored, so + * the <b>ident</b> object must outlive the request. + */ +void +directory_request_fetch_set_hs_ident(directory_request_t *req, + const hs_ident_dir_conn_t *ident) +{ + if (ident) { + tor_assert(req->dir_purpose == DIR_PURPOSE_FETCH_HSDESC); + } + req->hs_ident = ident; +} /** Set a static circuit_guard_state_t object to affliate with the request in * <b>req</b>. This object will receive notification when the attempt to * connect to the guard either succeeds or fails. */ |