From 785d4f136da4ef556d29fc4f56258d7e6350b96b Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 30 Oct 2026 15:24:41 +0100 Subject: allow dead Connection unless a transport needs it --- src/transport/tor.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/transport/tor.rs') diff --git a/src/transport/tor.rs b/src/transport/tor.rs index 39e0f31..2cf3249 100644 --- a/src/transport/tor.rs +++ b/src/transport/tor.rs @@ -544,6 +544,15 @@ impl Transport for TorTransport { parse_location(target) } + /// Direct while a connection to its onion service is open: an onion circuit, with no + /// relay of ours in between. + fn connection(&self, target: &str) -> Option { + let location = parse_location(target)?; + lock(&self.shared.connections) + .contains_key(&location) + .then_some(crate::transport::Connection::Direct) + } + /// An onion service is its own transport identity: nothing to find out. async fn resolve_seed(&self, seed: &str) -> Result { let location = parse_location(seed) -- cgit v1.3.1