From 727e92902ceff3a1ad6a8715e5b46b3f5803fd2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=A3rebe=20-=20Romain=20GERARD?= Date: Thu, 25 Apr 2024 21:22:38 +0200 Subject: [PATCH] Add log when closing remote tunnel --- src/tunnel/server.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tunnel/server.rs b/src/tunnel/server.rs index fe56ddd..92295b0 100644 --- a/src/tunnel/server.rs +++ b/src/tunnel/server.rs @@ -194,6 +194,7 @@ where listening_server } else { let listening_server = gen_listening_server.await?; + let send_timeout = Duration::from_secs(30); let (tx, rx) = mpsc::channel::(1); let fut = async move { pin_mut!(listening_server); @@ -208,7 +209,8 @@ where continue; } Some(Ok(cnx)) => { - if tx.send_timeout(cnx, Duration::from_secs(30)).await.is_err() { + if tx.send_timeout(cnx, send_timeout).await.is_err() { + info!("New remote connection failed to be picked by client after {}s. Closing remote tunnel server", send_timeout.as_secs()); break; } }