Reject DATAGRAMs larger than the send buffer#2626
Open
zerox80 wants to merge 3 commits into
Open
Conversation
134613b to
8976994
Compare
Ralith
reviewed
Apr 28, 2026
| .expect("datagrams.outgoing_total desynchronized"); | ||
| trace!(len = prev.data.len(), "dropping outgoing datagram"); | ||
| self.conn.datagrams.outgoing_total -= prev.data.len(); | ||
| if data.len() > self.conn.config.datagram_send_buffer_size { |
Collaborator
There was a problem hiding this comment.
Is the behavior correct when !drop?
8976994 to
c9ceb0c
Compare
Author
|
Updated this too. The size check now happens before the drop branch, so drop = false returns TooLarge for a datagram that cannot fit in the send buffer. I added a test for both send modes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #2625.
A DATAGRAM larger than
datagram_send_buffer_sizecannot fit in the outgoing send buffer by itself. This returnsTooLargebefore trying either send mode, so the behavior is the same fordrop = trueanddrop = false.Tested with: