diff --git a/prototypes/quic_demo/src/client_proxy.rs b/prototypes/quic_demo/src/client_proxy.rs index 87035e4..101ef79 100644 --- a/prototypes/quic_demo/src/client_proxy.rs +++ b/prototypes/quic_demo/src/client_proxy.rs @@ -55,7 +55,7 @@ pub struct ForwardingParams { pub async fn forward_port ( connection_p2_p3: quinn::Connection, params: ForwardingParams, - shutdown_flag_rx: tokio::sync::watch::Receiver , + mut shutdown_flag_rx: tokio::sync::watch::Receiver , ) -> anyhow::Result <()> { let ForwardingParams { @@ -69,8 +69,6 @@ pub async fn forward_port ( trace! ("Accepting local TCP connections from P1 on {}", client_tcp_port); while *shutdown_flag_rx.borrow () { - let mut shutdown_flag_rx_2 = shutdown_flag_rx.clone (); - tokio::select! { x = listener.accept () => { let (tcp_socket, _) = x?; @@ -80,7 +78,7 @@ pub async fn forward_port ( tokio::spawn (handle_p1 (connection, server_id, server_tcp_port, tcp_socket, shutdown_flag_rx)); }, - _ = shutdown_flag_rx_2.changed () => (), + _ = shutdown_flag_rx.changed () => (), }; }