Repository navigation
Send Connection: keep-alive to an HTTP/1.0 peer whose connection is kept - #268
Merged
Merged
Conversation
HTTP/1.0 is close-by-default, so a 1.0 client that asked to keep the connection only reuses it when the response says so (RFC 9112 9.3, appendix C.2.2). dusty kept such connections open without saying so, and the client then waited for the server to close it.
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 23 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Owner
|
I'm confused. I didn't know HTTP/1.0 allows keep-alive? OH, it does. That's new to me. |
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.
An HTTP/1.0 request with
Connection: keep-aliveis kept open (llhttp'sshould_keep_alivesays so), but the response doesn't say so. HTTP/1.0 is close-by-default, so the client must assume the server closes after the response (RFC 9112 §9.3 and appendix C.2.2) and waits for an EOF that never comes, while the server waits for the next request.ab -kagainst any dusty server hangs until apr's poll timeout:sendHeadernow writesConnection: keep-alivewhen the response is to an HTTP/1.0 request and the connection is kept. HTTP/1.1 responses are unchanged (no header when kept,Connection: closewhen not).Tests: the existing "HEAD streamed to an HTTP/1.0 peer keeps the connection" now checks the header; two new ones cover a buffered HTTP/1.0 response and an HTTP/1.1 response sending no Connection header.