diff --git a/transports/relay/src/handler.rs b/transports/relay/src/handler.rs index 9a506156222..d199491c41c 100644 --- a/transports/relay/src/handler.rs +++ b/transports/relay/src/handler.rs @@ -98,7 +98,7 @@ where /*let ev = RelayHandlerEvent::Destination { stream, src_peer_id }; self.queued_events.push(ev);*/ }, - RelayOutput::WaitRequest(_) => unimplemented!(), + RelayOutput::ProxyRequest(_) => unimplemented!(), } } diff --git a/transports/relay/src/protocol.rs b/transports/relay/src/protocol.rs index 311279bdc7f..7ac9a6d5472 100644 --- a/transports/relay/src/protocol.rs +++ b/transports/relay/src/protocol.rs @@ -37,10 +37,11 @@ pub struct RelayConfig { /// we pipe data from source to destination and do not want to use the stream in any other way. /// Therefore, in the latter case we simply return a future that can be driven to completion /// but otherwise the stream is not programmatically accessible. +// TODO: debug pub enum RelayOutput { /// We are successfully connected as a dialer, and we can now request the remote to act as a /// proxy. - WaitRequest(RelayWaitRequest), + ProxyRequest(RelayProxyRequest), /// We have been asked to become a destination. DestinationRequest(RelayDestinationRequest), /// We have been asked to relay communications to another node. @@ -48,13 +49,14 @@ pub enum RelayOutput { } /// We are successfully connected as a dialer, and we can now request the remote to act as a proxy. +// TODO: debug #[must_use = "There is no point in opening a request if you don't use"] -pub struct RelayWaitRequest { +pub struct RelayProxyRequest { /// The stream of the destination. stream: Io, } -impl RelayWaitRequest +impl RelayProxyRequest where TStream: AsyncRead + AsyncWrite + 'static { /// Request proxying to a destination. @@ -85,6 +87,7 @@ where TStream: AsyncRead + AsyncWrite + 'static } /// Request from a remote for us to become a destination. +// TODO: debug #[must_use = "A destination request should be either accepted or denied"] pub struct RelayDestinationRequest { /// The stream to the source. @@ -135,6 +138,7 @@ where TStream: AsyncRead + AsyncWrite + 'static } /// Request from a remote for us to relay communications to another node. +// TODO: debug #[must_use = "A HOP request should be either accepted or denied"] pub struct RelayHopRequest { /// The stream to the source. @@ -227,7 +231,7 @@ where fn upgrade(self, conn: C, _: (), endpoint: Endpoint) -> Self::Future { if let Endpoint::Dialer = endpoint { - let future = future::ok(RelayOutput::WaitRequest(RelayWaitRequest { + let future = future::ok(RelayOutput::ProxyRequest(RelayProxyRequest { stream: Io::new(conn), })); Box::new(future)