diff options
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/directory.c | 36 | ||||
-rw-r--r-- | src/or/or.h | 13 | ||||
-rw-r--r-- | src/or/router.c | 7 |
3 files changed, 12 insertions, 44 deletions
diff --git a/src/or/directory.c b/src/or/directory.c index 70feb73108..76ae45696e 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -31,13 +31,6 @@ const char directory_c_id[] = * connection_finished_connecting() in connection.c */ static void -directory_initiate_command(const char *address, uint32_t addr, uint16_t port, - int supports_begindir, - const char *digest, uint8_t purpose, - int private_connection, const char *resource, - const char *payload, size_t payload_len); - -static void directory_send_command(dir_connection_t *conn, int purpose, int direct, const char *resource, const char *payload, size_t payload_len); @@ -224,33 +217,6 @@ directory_get_from_dirserver(uint8_t purpose, const char *resource, } } -/** Launch a new connection to the directory server <b>router</b> to upload or - * download a service or rendezvous descriptor. <b>purpose</b> determines what - * kind of directory connection we're launching, and must be one of - * DIR_PURPOSE_{FETCH|UPLOAD}_{DIR|RENDDESC}. - * - * When uploading, <b>payload</b> and <b>payload_len</b> determine the content - * of the HTTP post. Otherwise, <b>payload</b> should be NULL. - * - * When fetching a rendezvous descriptor, <b>resource</b> is the service ID we - * want to fetch. - */ -void -directory_initiate_command_router(routerinfo_t *router, - int supports_begindir, - uint8_t purpose, - int private_connection, - const char *resource, - const char *payload, - size_t payload_len) -{ - directory_initiate_command(router->address, router->addr, router->dir_port, - supports_begindir, - router->cache_info.identity_digest, - purpose, private_connection, resource, - payload, payload_len); -} - /** Launch a new connection to the directory server <b>status</b> to upload or * download a server or rendezvous descriptor. <b>purpose</b> determines what * kind of directory connection we're launching, and must be one of @@ -398,7 +364,7 @@ connection_dir_download_routerdesc_failed(dir_connection_t *conn) * <b>addr</b>, whose directory port is <b>dir_port</b>, whose tor version * <b>supports_begindir</b>, and whose identity key digest is * <b>digest</b>. */ -static void +void directory_initiate_command(const char *address, uint32_t addr, uint16_t dir_port, int supports_begindir, const char *digest, uint8_t purpose, diff --git a/src/or/or.h b/src/or/or.h index 798088740d..d068c26d2b 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -2328,13 +2328,6 @@ void directory_post_to_dirservers(uint8_t purpose, const char *payload, size_t payload_len); void directory_get_from_dirserver(uint8_t purpose, const char *resource, int retry_if_no_servers); -void directory_initiate_command_router(routerinfo_t *router, - int supports_begindir, - uint8_t purpose, - int private_connection, - const char *resource, - const char *payload, - size_t payload_len); void directory_initiate_command_routerstatus(routerstatus_t *status, uint8_t purpose, int private_connection, @@ -2350,6 +2343,12 @@ int connection_dir_process_inbuf(dir_connection_t *conn); int connection_dir_finished_flushing(dir_connection_t *conn); int connection_dir_finished_connecting(dir_connection_t *conn); void connection_dir_request_failed(dir_connection_t *conn); +void directory_initiate_command(const char *address, uint32_t addr, + uint16_t dir_port, int supports_begindir, + const char *digest, uint8_t purpose, + int private_connection, const char *resource, + const char *payload, size_t payload_len); + int dir_split_resource_into_fingerprints(const char *resource, smartlist_t *fp_out, int *compresseed_out, int decode_hex, int sort_uniq); diff --git a/src/or/router.c b/src/or/router.c index b2d5444d57..f2cf47f40d 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -496,8 +496,11 @@ consider_testing_reachability(int test_or, int test_dir) CONN_TYPE_DIR, me->addr, me->dir_port, DIR_PURPOSE_FETCH_SERVERDESC)) { /* ask myself, via tor, for my server descriptor. */ - directory_initiate_command_router(me, 0, DIR_PURPOSE_FETCH_SERVERDESC, - 1, "authority", NULL, 0); + directory_initiate_command(me->address, me->addr, me->dir_port, + 0, me->cache_info.identity_digest, + DIR_PURPOSE_FETCH_SERVERDESC, + 1, "authority", NULL, 0); + control_event_server_status(LOG_NOTICE, "CHECKING_REACHABILITY DIRADDRESS=%s:%d", me->address, me->dir_port); |