From d146cdbb7dce34980e30e3ed743e35af25f5c736 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20CORTIER?= Date: Wed, 14 Aug 2024 13:41:31 +0900 Subject: [PATCH] refactor: follow up to PR 530 --- crates/ironrdp-acceptor/src/connection.rs | 4 ++-- crates/ironrdp-server/src/server.rs | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/crates/ironrdp-acceptor/src/connection.rs b/crates/ironrdp-acceptor/src/connection.rs index e5248560d..d1f99ee69 100644 --- a/crates/ironrdp-acceptor/src/connection.rs +++ b/crates/ironrdp-acceptor/src/connection.rs @@ -97,7 +97,7 @@ impl Acceptor { self.static_channels.insert(channel); - // restore channel id if it was already attached + // Restore channel id if it was already attached. if let AcceptorState::CapabilitiesSendServer { channels, .. } = &self.state { for (channel_id, c) in channels { if c.name == channel_name { @@ -316,7 +316,7 @@ impl Sequence for Acceptor { }) .unwrap_or_default(); - #[allow(clippy::arithmetic_side_effects)] // IO channel ID is not big enough for overflowing + #[allow(clippy::arithmetic_side_effects)] // IO channel ID is not big enough for overflowing. let channels = joined .into_iter() .enumerate() diff --git a/crates/ironrdp-server/src/server.rs b/crates/ironrdp-server/src/server.rs index 157c513f1..53a0050b1 100644 --- a/crates/ironrdp-server/src/server.rs +++ b/crates/ironrdp-server/src/server.rs @@ -272,7 +272,7 @@ impl RdpServer { let res = ironrdp_acceptor::accept_begin(framed, &mut acceptor) .await - .context("Accept begin error")?; + .context("accept_begin failed")?; match res { BeginResult::ShouldUpgrade(stream) => { @@ -403,7 +403,7 @@ impl RdpServer { DisplayUpdate::HidePointer => encoder.hide_pointer(), DisplayUpdate::DefaultPointer => encoder.default_pointer(), } - .context("Error during update encoding")?; + .context("error during update encoding")?; if fragmenter.size_hint() > buffer.len() { buffer.resize(fragmenter.size_hint(), 0); @@ -413,7 +413,7 @@ impl RdpServer { framed .write_all(&buffer[..len]) .await - .context("Write display update error")?; + .context("failed to write display update")?; } Ok(RunState::Continue) @@ -457,7 +457,7 @@ impl RdpServer { continue; } } - .context("Sending rdpsnd event")?; + .context("failed to send rdpsnd event")?; let channel_id = self .get_channel_id_by_type::() .ok_or_else(|| anyhow!("SVC channel not found"))?; @@ -478,7 +478,7 @@ impl RdpServer { continue; } } - .context("Sending clipboard event")?; + .context("failed to send clipboard event")?; let channel_id = self .get_channel_id_by_type::() .ok_or_else(|| anyhow!("SVC channel not found"))?; @@ -627,7 +627,7 @@ impl RdpServer { let state = self .client_loop(framed, result.io_channel_id, result.user_channel_id, encoder) .await - .context("Error in client loop")?; + .context("client loop failure")?; Ok(state) } @@ -804,7 +804,7 @@ impl RdpServer { loop { let (new_framed, result) = ironrdp_acceptor::accept_finalize(framed, &mut acceptor) .await - .context("Failed to accept client during finalize")?; + .context("failed to accept client during finalize")?; framed = new_framed; match self.client_accepted(&mut framed, result).await? {