diff options
author | George Kadianakis <desnacked@riseup.net> | 2017-05-22 14:10:38 +0300 |
---|---|---|
committer | George Kadianakis <desnacked@riseup.net> | 2017-05-22 15:57:33 +0300 |
commit | 52498b8183a2ab1da525180ee76f704d8257ebc6 (patch) | |
tree | 8843e6d95581e037d256e515e111d68c74b0e8dc /src/or/bridges.c | |
parent | bbeba2412e58501da4097409258d329ca97edb2e (diff) | |
download | tor-52498b8183a2ab1da525180ee76f704d8257ebc6.tar.gz tor-52498b8183a2ab1da525180ee76f704d8257ebc6.zip |
Set guard state on bridge descriptor fetches.
We used to not set the guard state in launch_direct_bridge_descriptor_fetch().
So when a bridge descriptor fetch failed, the guard subsystem would never
learn about the fail (and hence the guard's reachability state would not
be updated).
Diffstat (limited to 'src/or/bridges.c')
-rw-r--r-- | src/or/bridges.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/or/bridges.c b/src/or/bridges.c index ef0638c0a7..0818fb0812 100644 --- a/src/or/bridges.c +++ b/src/or/bridges.c @@ -547,6 +547,7 @@ static void launch_direct_bridge_descriptor_fetch(bridge_info_t *bridge) { const or_options_t *options = get_options(); + circuit_guard_state_t *guard_state = NULL; if (connection_get_by_type_addr_port_purpose( CONN_TYPE_DIR, &bridge->addr, bridge->port, @@ -574,12 +575,17 @@ launch_direct_bridge_descriptor_fetch(bridge_info_t *bridge) memcpy(&bridge_addrport.addr, &bridge->addr, sizeof(tor_addr_t)); bridge_addrport.port = bridge->port; + guard_state = get_guard_state_for_bridge_desc_fetch(bridge->identity); + directory_request_t *req = directory_request_new(DIR_PURPOSE_FETCH_SERVERDESC); directory_request_set_or_addr_port(req, &bridge_addrport); directory_request_set_directory_id_digest(req, bridge->identity); directory_request_set_router_purpose(req, ROUTER_PURPOSE_BRIDGE); directory_request_set_resource(req, "authority.z"); + if (guard_state) { + directory_request_set_guard_state(req, guard_state); + } directory_initiate_request(req); directory_request_free(req); } |