fix(datagram): preserve quarter stream id - #340
Merged
seanmonstar merged 3 commits intoAug 7, 2026
Conversation
Streetblock
approved these changes
Aug 5, 2026
Streetblock
left a comment
Contributor
There was a problem hiding this comment.
Tested this commit in an isolated merge against current upstream/master.
- the merge is conflict-free
cargo fmt --all -- --checkpassescargo test --workspacepasses (227 h3 tests, the h3-datagram test, and 9 documentation tests)- the only warning is the pre-existing direct-path
h3-quinncfg warning tracked separately in #335
I also expanded the round-trip test locally across all QUIC VarInt width boundaries for Quarter Stream IDs (0, 1, 2^6-1, 2^6, 2^14-1, 2^14, 2^30-1, 2^30, and 2^60-1). All cases preserve the original stream ID and payload.
The one-line production fix correctly uses the already encoded header buffer instead of replacing it with zeros. The broader boundary table could be a useful optional test enhancement, but I do not consider it a merge blocker.
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.
h3-datagramencoded the Quarter Stream ID correctly, but then stored a zeroed buffer inEncodedDatagram. As a result, every outgoing HTTP/3 Datagram was serialized with Quarter Stream ID0.This breaks datagrams for later request streams on the same HTTP/3 connection, for example when multiple MASQUE CONNECT-UDP sessions share one H3 connection. Those datagrams appear to belong to the first request stream and may be routed to the wrong session, ignored, or rejected.