GuardMgr: Fix build with bridge-client disabled.

This commit is contained in:
Nick Mathewson 2022-11-04 16:10:42 -04:00
parent 6bcce19655
commit 9fda8d17c4
2 changed files with 4 additions and 1 deletions

View File

@ -1320,7 +1320,7 @@ impl GuardMgrInner {
// guard, and we aren't using bridges, then we may be able to use a
// fallback.
if usage.kind == GuardUsageKind::OneHopDirectory
&& self.guards.active_set.universe_type() != UniverseType::BridgeSet
&& self.guards.active_set.universe_type() == UniverseType::NetDir
{
return self.select_fallback(now);
}
@ -1336,6 +1336,7 @@ impl GuardMgrInner {
now: Instant,
) -> Result<(sample::ListKind, FirstHop), PickGuardError> {
let active_set = &self.guards.active_set;
#[cfg_attr(not(feature = "bridge-client"), allow(unused_mut))]
let (list_kind, mut first_hop) =
self.guards
.guards(active_set)
@ -1477,6 +1478,7 @@ enum FirstHopInner {
Chan(OwnedChanTarget),
/// We have enough information to connect to a guards _and_ to build
/// multihop circuits through it.
#[cfg_attr(not(feature = "bridge-client"), allow(dead_code))]
Circ(OwnedCircTarget),
}

View File

@ -21,6 +21,7 @@ use std::collections::{HashMap, HashSet};
use std::time::{Instant, SystemTime};
use tracing::{debug, info};
#[allow(unused_imports)]
pub(crate) use candidate::{Candidate, CandidateStatus, Universe, UniverseRef, WeightThreshold};
/// A set of sampled guards, along with various orderings on subsets