From 4ae65bb5d37b85df19984dc19eedca31f2ae5557 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 21 Apr 2017 14:40:48 -0400 Subject: [PATCH] Refactor directory_get_from_dirserver to use request API. --- src/or/directory.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/or/directory.c b/src/or/directory.c index 386ba2f39d..12c45cfff5 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -627,12 +627,16 @@ MOCK_IMPL(void, directory_get_from_dirserver, ( if (rs) { const dir_indirection_t indirection = get_via_tor ? DIRIND_ANONYMOUS : DIRIND_ONEHOP; - directory_initiate_command_routerstatus(rs, dir_purpose, - router_purpose, - indirection, - resource, NULL, 0, - if_modified_since, - guard_state); + 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_indirection(req, indirection); + directory_request_set_resource(req, resource); + directory_request_set_if_modified_since(req, if_modified_since); + if (guard_state) + directory_request_set_guard_state(req, guard_state); + directory_initiate_request(req); + directory_request_free(req); } else { log_notice(LD_DIR, "While fetching directory info, "