From 82c7c2f5b08c44b1a4f6b04c13ad24d9e2ffa371 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Mon, 20 Jan 2025 16:25:23 +0400 Subject: [PATCH] fix(server): do not restart static channels on reactivation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marc-André Lureau --- crates/ironrdp-acceptor/src/connection.rs | 2 ++ crates/ironrdp-server/src/server.rs | 18 ++++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/crates/ironrdp-acceptor/src/connection.rs b/crates/ironrdp-acceptor/src/connection.rs index f6354cb3..5263f792 100644 --- a/crates/ironrdp-acceptor/src/connection.rs +++ b/crates/ironrdp-acceptor/src/connection.rs @@ -43,6 +43,7 @@ pub struct AcceptorResult { pub input_events: Vec>, pub user_channel_id: u16, pub io_channel_id: u16, + pub reactivation: bool, } impl Acceptor { @@ -150,6 +151,7 @@ impl Acceptor { input_events, user_channel_id: self.user_channel_id, io_channel_id: self.io_channel_id, + reactivation: self.reactivation, }), previous_state => { self.state = previous_state; diff --git a/crates/ironrdp-server/src/server.rs b/crates/ironrdp-server/src/server.rs index bf2378cc..f3248ab2 100644 --- a/crates/ironrdp-server/src/server.rs +++ b/crates/ironrdp-server/src/server.rs @@ -670,14 +670,16 @@ impl RdpServer { } self.static_channels = result.static_channels; - for (_type_id, channel, channel_id) in self.static_channels.iter_mut() { - debug!(?channel, ?channel_id, "Start"); - let Some(channel_id) = channel_id else { - continue; - }; - let svc_responses = channel.start()?; - let response = server_encode_svc_messages(svc_responses, channel_id, result.user_channel_id)?; - writer.write_all(&response).await?; + if !result.reactivation { + for (_type_id, channel, channel_id) in self.static_channels.iter_mut() { + debug!(?channel, ?channel_id, "Start"); + let Some(channel_id) = channel_id else { + continue; + }; + let svc_responses = channel.start()?; + let response = server_encode_svc_messages(svc_responses, channel_id, result.user_channel_id)?; + writer.write_all(&response).await?; + } } let mut rfxcodec = None;