Skip to content

Commit

Permalink
udp: don't add messages to resend queue more than once (bugfix)
Browse files Browse the repository at this point in the history
  • Loading branch information
greatest-ape committed Feb 2, 2025
1 parent 94e3af2 commit 8881080
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crates/udp/src/workers/socket/mio/socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,9 @@ impl<V: IpVersion> Socket<V> {
Ok(_) => (),
Err(err) => match self.opt_resend_buffer.as_mut() {
Some(resend_buffer)
if !disable_resend_buffer && (err.raw_os_error() == Some(libc::ENOBUFS))
|| (err.kind() == ErrorKind::WouldBlock) =>
if !disable_resend_buffer
&& ((err.raw_os_error() == Some(libc::ENOBUFS))
|| (err.kind() == ErrorKind::WouldBlock)) =>
{
if resend_buffer.len() < shared.config.network.resend_buffer_max_len {
::log::debug!("Adding response to resend queue, since sending it to {} failed with: {:#}", addr, err);
Expand Down

0 comments on commit 8881080

Please sign in to comment.