Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: follow up to PR 530 #531

Merged
merged 1 commit into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/ironrdp-acceptor/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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()
Expand Down
14 changes: 7 additions & 7 deletions crates/ironrdp-server/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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);
Expand All @@ -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)
Expand Down Expand Up @@ -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::<RdpsndServer>()
.ok_or_else(|| anyhow!("SVC channel not found"))?;
Expand All @@ -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::<CliprdrServer>()
.ok_or_else(|| anyhow!("SVC channel not found"))?;
Expand Down Expand Up @@ -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)
}
Expand Down Expand Up @@ -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? {
Expand Down