aboutsummaryrefslogtreecommitdiff
path: root/src/or/circuitbuild.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2007-11-16 07:31:51 +0000
committerRoger Dingledine <arma@torproject.org>2007-11-16 07:31:51 +0000
commit0871e02da8105fed86d0ae3720cac1c1c2cc6d3d (patch)
tree005107ecade9382f393e47c03bdddbf6380f8e03 /src/or/circuitbuild.c
parent116a0f0f22eef6cb77a81fcfc9abb0a875e8b69f (diff)
downloadtor-0871e02da8105fed86d0ae3720cac1c1c2cc6d3d.tar.gz
tor-0871e02da8105fed86d0ae3720cac1c1c2cc6d3d.zip
If we're trying to fetch a bridge descriptor and there's no way
the bridge authority could help us (for example, we don't know a digest, or there is no bridge authority), don't be so eager to fall back to asking the bridge authority. svn:r12512
Diffstat (limited to 'src/or/circuitbuild.c')
-rw-r--r--src/or/circuitbuild.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 3a86b95b6c..847dfb1eaa 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -2945,6 +2945,7 @@ fetch_bridge_descriptors(time_t now)
or_options_t *options = get_options();
int num_bridge_auths = get_n_authorities(BRIDGE_AUTHORITY);
int ask_bridge_directly;
+ int can_use_bridge_authority;
if (!bridge_list)
return;
@@ -2960,9 +2961,10 @@ fetch_bridge_descriptors(time_t now)
in.s_addr = htonl(bridge->addr);
tor_inet_ntoa(&in, address_buf, sizeof(address_buf));
- ask_bridge_directly = tor_digest_is_zero(bridge->identity) ||
- !options->UpdateBridgesFromAuthority ||
- !num_bridge_auths;
+ can_use_bridge_authority = !tor_digest_is_zero(bridge->identity) &&
+ num_bridge_auths;
+ ask_bridge_directly = !can_use_bridge_authority ||
+ !options->UpdateBridgesFromAuthority;
log_debug(LD_DIR, "ask_bridge_directly=%d (%d, %d, %d)",
ask_bridge_directly, tor_digest_is_zero(bridge->identity),
!options->UpdateBridgesFromAuthority, !num_bridge_auths);
@@ -2971,9 +2973,9 @@ fetch_bridge_descriptors(time_t now)
!fascist_firewall_allows_address_or(bridge->addr, bridge->port)) {
log_notice(LD_DIR, "Bridge at '%s:%d' isn't reachable by our "
"firewall policy. %s.", address_buf, bridge->port,
- num_bridge_auths ? "Asking bridge authority instead" :
- "Skipping");
- if (num_bridge_auths)
+ can_use_bridge_authority ?
+ "Asking bridge authority instead" : "Skipping");
+ if (can_use_bridge_authorit)
ask_bridge_directly = 0;
else
continue;