Add the necessary APIs for bridge-based circuit construction.
This commit is contained in:
parent
1196e1b680
commit
3272c6fb04
|
@ -182,6 +182,7 @@ impl<'a> ExitPathBuilder<'a> {
|
|||
}
|
||||
let guard_usage = b.build().expect("Failed while building guard usage!");
|
||||
let (guard, mut mon, usable) = guardmgr.select_guard(guard_usage, Some(netdir))?;
|
||||
// TODO pt-client: First try as_circ_target; then try get_relay.
|
||||
let guard = guard.get_relay(netdir).ok_or_else(|| {
|
||||
internal!(
|
||||
"Somehow the guardmgr gave us an unlisted guard {:?}!",
|
||||
|
|
|
@ -1345,8 +1345,18 @@ impl FirstHop {
|
|||
}
|
||||
/// Look up this guard in `netdir`.
|
||||
pub fn get_relay<'a>(&self, netdir: &'a NetDir) -> Option<Relay<'a>> {
|
||||
// TODO pt-client: This should always return "None" for a bridge.
|
||||
self.id().get_relay(netdir)
|
||||
}
|
||||
|
||||
/// If possible, return a view of this object that can be used to build a circuit.
|
||||
///
|
||||
/// TODO pt-client: This will need to return "Some" only for bridges that have
|
||||
/// a bridge descriptor.
|
||||
#[allow(clippy::missing_panics_doc)]
|
||||
pub fn as_circ_target(&self) -> Option<tor_linkspec::OwnedCircTarget> {
|
||||
todo!() // TODO pt-client: Implement
|
||||
}
|
||||
}
|
||||
|
||||
// This is somewhat redundant with the implementations in crate::guard::Guard.
|
||||
|
|
Loading…
Reference in New Issue