fix: connection level flow control accounting for empty, non-fin frames#2491
Open
gregor-cf wants to merge 1 commit into
Open
fix: connection level flow control accounting for empty, non-fin frames#2491gregor-cf wants to merge 1 commit into
gregor-cf wants to merge 1 commit into
Conversation
csujedihy
approved these changes
May 21, 2026
ghedo
requested changes
May 22, 2026
b2549ad to
32d889b
Compare
Contributor
Author
|
addressed all review comments |
This fixes a bug in connection level flow control accounting. When an empty STREAM frame without FIN is received, we calcuate the difference between the highest previously received offset and the frame's max_off and add that to connection level flow control. However, in `RecvBuf::write()` we return early and we do not update the highest received offset. On subsequent frames, we count the same bytes against conn level flow control again. To fix this, we update the highest receive offset in RecvBuf::write(). The alternative would be to ignore such frames, but I think updating the high water mark is the right choice: It mimmicks what we do for empty FIN frames and https://datatracker.ietf.org/doc/html/rfc9000#section-19.8 also say > When a Stream Data field has a length of 0, the offset in the STREAM frame is the offset of the next byte that would be sent.
32d889b to
8fc8d39
Compare
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.
This fixes a bug in connection level flow control accounting. When an empty STREAM frame without FIN is received, we calcuate the difference between the highest previously received offset and the frame's max_off and add that to connection level flow control. However, in
RecvBuf::write()we return early and we do not update the highest received offset. On subsequent frames, we count the same bytes against conn level flow control again.To fix this, we update the highest receive offset in RecvBuf::write(). The alternative would be to ignore such frames, but I think updating the high water mark is the right choice: It mimmicks what we do for empty FIN frames and https://datatracker.ietf.org/doc/html/rfc9000#section-19.8 also says