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

DatagramState::drop_oversized should update DatagramState::outgoing_total #1985

Open
dongcarl opened this issue Sep 10, 2024 · 1 comment · May be fixed by #1987
Open

DatagramState::drop_oversized should update DatagramState::outgoing_total #1985

dongcarl opened this issue Sep 10, 2024 · 1 comment · May be fixed by #1987

Comments

@dongcarl
Copy link

I could be mistaken, but it seems that DatagramState::outgoing_total is updated every time DatagramState::outgoing is touched, except for in DatagramState::drop_oversized, is there a reason for this?

pub(super) fn drop_oversized(&mut self, max_payload: usize) {
self.outgoing.retain(|datagram| {
let result = datagram.data.len() < max_payload;
if !result {
trace!(
"dropping {} byte datagram violating {} byte limit",
datagram.data.len(),
max_payload
);
}
result
});
}

@djc
Copy link
Member

djc commented Sep 11, 2024

Ah, you're right! That does look like a bug -- see proposed trivial fix in #1987.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants