diff options
Diffstat (limited to 'src/transport/tor.rs')
| -rw-r--r-- | src/transport/tor.rs | 9 |
1 files changed, 9 insertions, 0 deletions
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<crate::transport::Connection> { + 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<String> { let location = parse_location(seed) |
