Refactor directory_get_from_dirserver to use request API.

This commit is contained in:
Nick Mathewson 2017-04-21 14:40:48 -04:00
parent eee733be33
commit 4ae65bb5d3

View File

@ -627,12 +627,16 @@ MOCK_IMPL(void, directory_get_from_dirserver, (
if (rs) { if (rs) {
const dir_indirection_t indirection = const dir_indirection_t indirection =
get_via_tor ? DIRIND_ANONYMOUS : DIRIND_ONEHOP; get_via_tor ? DIRIND_ANONYMOUS : DIRIND_ONEHOP;
directory_initiate_command_routerstatus(rs, dir_purpose, directory_request_t *req = directory_request_new(dir_purpose);
router_purpose, directory_request_set_routerstatus(req, rs);
indirection, directory_request_set_router_purpose(req, router_purpose);
resource, NULL, 0, directory_request_set_indirection(req, indirection);
if_modified_since, directory_request_set_resource(req, resource);
guard_state); 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 { } else {
log_notice(LD_DIR, log_notice(LD_DIR,
"While fetching directory info, " "While fetching directory info, "