♻️ refactor: remove redundant var
parent
e8bb7ab098
commit
baa5044186
|
@ -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 <bool>,
|
||||
mut shutdown_flag_rx: tokio::sync::watch::Receiver <bool>,
|
||||
) -> 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 () => (),
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue