fix(http1): allow keep-alive for chunked requests with trailers#4043
Merged
seanmonstar merged 2 commits intohyperium:masterfrom Mar 27, 2026
Merged
fix(http1): allow keep-alive for chunked requests with trailers#4043seanmonstar merged 2 commits intohyperium:masterfrom
seanmonstar merged 2 commits intohyperium:masterfrom
Conversation
When a chunked request body included trailers, poll_read_body incorrectly transitioned to Reading::Closed instead of Reading::KeepAlive. This prevented connection reuse for any request that sent trailers, even though trailers signal body completion just like a final data frame at EOF. Closes #4039
seanmonstar
approved these changes
Mar 27, 2026
Member
seanmonstar
left a comment
There was a problem hiding this comment.
I'm so glad the fix was so simple. Thanks for fixing this, and for adding a test, much appreciated!
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.
Summary
poll_read_bodyinconn.rsincorrectly transitioned toReading::Closedinstead ofReading::KeepAlive, preventing connection reuse.Test plan
http1_trailer_recv_keep_alivepasses with fixConnectionReseton second request)cargo test --features full— 271 tests, 0 failures)rustfmtcleandead_codeorunused_importswarnings