fix(server): do not restart static channels on reactivation

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
Marc-André Lureau
2025-01-27 07:35:36 -05:00
committed by Benoît Cortier
parent c4587b537c
commit 82c7c2f5b0
2 changed files with 12 additions and 8 deletions
@@ -43,6 +43,7 @@ pub struct AcceptorResult {
pub input_events: Vec<Vec<u8>>,
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;
+10 -8
View File
@@ -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;