summaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2017-05-22 15:45:46 +0300
committerGeorge Kadianakis <desnacked@riseup.net>2017-05-22 15:45:46 +0300
commite102ad60d0490abf97102644960a9c602c658992 (patch)
treea2ac92508900d245a63eb223080395543966c3c8 /src/or
parentd1340bd5ac905e650dfdad53aeba0361231def16 (diff)
downloadtor-e102ad60d0490abf97102644960a9c602c658992.tar.gz
tor-e102ad60d0490abf97102644960a9c602c658992.zip
Refactor directory_initiate_command() so that it accepts guard_state.
Diffstat (limited to 'src/or')
-rw-r--r--src/or/bridges.c2
-rw-r--r--src/or/directory.c6
-rw-r--r--src/or/directory.h4
-rw-r--r--src/or/router.c3
-rw-r--r--src/or/routerlist.c2
5 files changed, 11 insertions, 6 deletions
diff --git a/src/or/bridges.c b/src/or/bridges.c
index 88154c6c8a..58375caf12 100644
--- a/src/or/bridges.c
+++ b/src/or/bridges.c
@@ -575,7 +575,7 @@ launch_direct_bridge_descriptor_fetch(bridge_info_t *bridge)
bridge->identity,
DIR_PURPOSE_FETCH_SERVERDESC,
ROUTER_PURPOSE_BRIDGE,
- DIRIND_ONEHOP, "authority.z", NULL, 0, 0);
+ DIRIND_ONEHOP, "authority.z", NULL, 0, 0, NULL);
}
/** Fetching the bridge descriptor from the bridge authority returned a
diff --git a/src/or/directory.c b/src/or/directory.c
index 70437fe755..edd07af95c 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -1131,6 +1131,7 @@ directory_command_should_use_begindir(const or_options_t *options,
* <b>router_purpose</b>, making an (in)direct connection as specified in
* <b>indirection</b>, with command <b>resource</b>, <b>payload</b> of
* <b>payload_len</b>, and asking for a result only <b>if_modified_since</b>.
+ * If <b>guard_state</b> is set, assign it to the directory circuit.
*/
void
directory_initiate_command(const tor_addr_t *or_addr, uint16_t or_port,
@@ -1139,7 +1140,8 @@ directory_initiate_command(const tor_addr_t *or_addr, uint16_t or_port,
uint8_t dir_purpose, uint8_t router_purpose,
dir_indirection_t indirection, const char *resource,
const char *payload, size_t payload_len,
- time_t if_modified_since)
+ time_t if_modified_since,
+ circuit_guard_state_t *guard_state)
{
tor_addr_port_t or_ap, dir_ap;
@@ -1166,7 +1168,7 @@ directory_initiate_command(const tor_addr_t *or_addr, uint16_t or_port,
digest, dir_purpose,
router_purpose, indirection,
resource, payload, payload_len,
- if_modified_since, NULL, NULL);
+ if_modified_since, NULL, guard_state);
}
/** Same as directory_initiate_command(), but accepts rendezvous data to
diff --git a/src/or/directory.h b/src/or/directory.h
index 8be1f8e76e..3d430f485a 100644
--- a/src/or/directory.h
+++ b/src/or/directory.h
@@ -12,6 +12,7 @@
#ifndef TOR_DIRECTORY_H
#define TOR_DIRECTORY_H
+
int directories_have_accepted_server_descriptor(void);
void directory_post_to_dirservers(uint8_t dir_purpose, uint8_t router_purpose,
dirinfo_type_t type, const char *payload,
@@ -79,7 +80,8 @@ void directory_initiate_command(const tor_addr_t *or_addr, uint16_t or_port,
dir_indirection_t indirection,
const char *resource,
const char *payload, size_t payload_len,
- time_t if_modified_since);
+ time_t if_modified_since,
+ struct circuit_guard_state_t *guard_state);
#define DSR_HEX (1<<0)
#define DSR_BASE64 (1<<1)
diff --git a/src/or/router.c b/src/or/router.c
index e4fa72a283..ddcf9ab5e4 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -1390,7 +1390,8 @@ consider_testing_reachability(int test_or, int test_dir)
me->cache_info.identity_digest,
DIR_PURPOSE_FETCH_SERVERDESC,
ROUTER_PURPOSE_GENERAL,
- DIRIND_ANON_DIRPORT, "authority.z", NULL, 0, 0);
+ DIRIND_ANON_DIRPORT, "authority.z",
+ NULL, 0, 0, NULL);
}
}
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 45b3838792..b68db750c3 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -961,7 +961,7 @@ authority_certs_fetch_resource_impl(const char *resource,
DIR_PURPOSE_FETCH_CERTIFICATE,
0,
indirection,
- resource, NULL, 0, 0);
+ resource, NULL, 0, 0, NULL);
return;
}