aboutsummaryrefslogtreecommitdiff
path: root/src/or/router.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-04-21 15:08:28 -0400
committerNick Mathewson <nickm@torproject.org>2017-04-21 15:08:28 -0400
commit8aadd60eac6d2b4feb176e34805b4bd5a8b77aed (patch)
tree17a30e24707bd2fc6efc635dd2a3d909cffb628f /src/or/router.c
parent4e393f53188055e478c0292af504fb97d02a4ff2 (diff)
downloadtor-8aadd60eac6d2b4feb176e34805b4bd5a8b77aed.tar.gz
tor-8aadd60eac6d2b4feb176e34805b4bd5a8b77aed.zip
Replace remaining directory_initiate_command_* instances
Diffstat (limited to 'src/or/router.c')
-rw-r--r--src/or/router.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/or/router.c b/src/or/router.c
index 7fb49e8eba..2336a5d3df 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -1470,13 +1470,23 @@ consider_testing_reachability(int test_or, int test_dir)
!connection_get_by_type_addr_port_purpose(
CONN_TYPE_DIR, &addr, me->dir_port,
DIR_PURPOSE_FETCH_SERVERDESC)) {
+ tor_addr_port_t my_orport, my_dirport;
+ memcpy(&my_orport.addr, &addr, sizeof(addr));
+ memcpy(&my_dirport.addr, &addr, sizeof(addr));
+ my_orport.port = me->or_port;
+ my_dirport.port = me->dir_port;
/* ask myself, via tor, for my server descriptor. */
- directory_initiate_command(&addr, me->or_port,
- &addr, me->dir_port,
- me->cache_info.identity_digest,
- DIR_PURPOSE_FETCH_SERVERDESC,
- ROUTER_PURPOSE_GENERAL,
- DIRIND_ANON_DIRPORT, "authority.z", NULL, 0, 0);
+ directory_request_t *req =
+ directory_request_new(DIR_PURPOSE_FETCH_SERVERDESC);
+ directory_request_set_or_addr_port(req, &my_orport);
+ directory_request_set_dir_addr_port(req, &my_dirport);
+ directory_request_set_directory_id_digest(req,
+ me->cache_info.identity_digest);
+ // ask via an anon circuit, connecting to our dirport.
+ directory_request_set_indirection(req, DIRIND_ANON_DIRPORT);
+ directory_request_set_resource(req, "authority.z");
+ directory_initiate_request(req);
+ directory_request_free(req);
}
}