aboutsummaryrefslogtreecommitdiff
path: root/src/or/directory.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-04-21 14:31:35 -0400
committerNick Mathewson <nickm@torproject.org>2017-04-21 14:31:35 -0400
commitc300fd7e65b699c3d2704737cd0c73276ca0a346 (patch)
tree54786454ba7ab18c690b4f40b29b904a5189dfac /src/or/directory.c
parenta55bd00b0f41afca767a57e2da4a3dc6a26d2110 (diff)
downloadtor-c300fd7e65b699c3d2704737cd0c73276ca0a346.tar.gz
tor-c300fd7e65b699c3d2704737cd0c73276ca0a346.zip
Have directory_get_from_all_authorities use requests.
Diffstat (limited to 'src/or/directory.c')
-rw-r--r--src/or/directory.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/or/directory.c b/src/or/directory.c
index ea3683d34b..1996e565b9 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -655,15 +655,17 @@ directory_get_from_all_authorities(uint8_t dir_purpose,
SMARTLIST_FOREACH_BEGIN(router_get_trusted_dir_servers(),
dir_server_t *, ds) {
- routerstatus_t *rs;
if (router_digest_is_me(ds->digest))
continue;
if (!(ds->type & V3_DIRINFO))
continue;
- rs = &ds->fake_status;
- directory_initiate_command_routerstatus(rs, dir_purpose, router_purpose,
- DIRIND_ONEHOP, resource, NULL,
- 0, 0, NULL);
+ const routerstatus_t *rs = &ds->fake_status;
+ directory_request_t *req = directory_request_new(dir_purpose);
+ directory_request_set_routerstatus(req, rs);
+ directory_request_set_router_purpose(req, router_purpose);
+ directory_request_set_resource(req, resource);
+ directory_initiate_request(req);
+ directory_request_free(req);
} SMARTLIST_FOREACH_END(ds);
}
@@ -1320,8 +1322,8 @@ directory_request_set_dir_from_routerstatus(directory_request_t *req)
return 0;
}
-void
-directory_initiate_request(directory_request_t *request)
+MOCK_IMPL(void,
+directory_initiate_request,(directory_request_t *request))
{
tor_assert(request);
if (request->routerstatus) {