From de052b2aaf2447ee92300d1fe4d3a8ea17c27493 Mon Sep 17 00:00:00 2001 From: rustdesk Date: Sat, 5 Sep 2026 11:44:46 +0800 Subject: [PATCH] port forward: the connect guard counts a live tunnel as connected `connect_port_forward_if_needed` returned early only for a raw-pipe socket; called again with a tunnel up it would have built a second `PortForwardMux` and dropped every channel of the first. Not reachable today, since the logon response is sent once, but the other checks in this change already read `is_port_forward()`. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01EZ49AbZJYfm8NTp5yDPMab --- src/server/connection.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/connection.rs b/src/server/connection.rs index a50d9e284..119402da5 100644 --- a/src/server/connection.rs +++ b/src/server/connection.rs @@ -1661,7 +1661,7 @@ impl Connection { } async fn connect_port_forward_if_needed(&mut self) -> bool { - if self.port_forward_socket.is_some() { + if self.is_port_forward() { return true; } let Some(login_request::Union::PortForward(pf)) = self.lr.union.as_ref() else {