Skip to content

Commit

Permalink
feat(server): check client size.
Browse files Browse the repository at this point in the history
It's problematic when the client didn't resize, as we send bitmap
updates that don't fit. The client will likely drop the connection.
Let's have a warning for this case in the server.

Signed-off-by: Marc-André Lureau <[email protected]>
  • Loading branch information
elmarco committed Jan 22, 2025
1 parent edb8452 commit 6a92e44
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions crates/ironrdp-server/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,24 @@ impl RdpServer {
bail!("Fastpath output not supported!");
}
}
CapabilitySet::Bitmap(b) => {
if !b.desktop_resize_flag {
debug!("Desktop resize is not supported by the client");
continue;
}
let client_size = DesktopSize {
width: b.desktop_width,
height: b.desktop_height,
};
let display_size = self.display.lock().await.size().await;
if client_size.width < display_size.width || client_size.height < display_size.height {
// TODO: we may have different behaviour instead, such as clipping or scaling?
warn!(
"Client size doesn't fit the server size: {:?} < {:?}",
client_size, display_size
);
}
}
CapabilitySet::SurfaceCommands(c) => {
surface_flags = c.flags;
}
Expand Down

0 comments on commit 6a92e44

Please sign in to comment.