Carefully manage Keep-Alive connections in HttpStaticFileServer#8914
Merged
normanmaurer merged 1 commit intonetty:4.1from Mar 6, 2019
Merged
Carefully manage Keep-Alive connections in HttpStaticFileServer#8914normanmaurer merged 1 commit intonetty:4.1from
normanmaurer merged 1 commit intonetty:4.1from
Conversation
|
Can one of the admins verify this patch? |
normanmaurer
requested changes
Mar 5, 2019
Member
There was a problem hiding this comment.
@kachayev this is not correct as you already write a FullHttpResonse and so MUST NOT write an extra LastHttpContent
Motivation: Simple rules: * close the connection when sending any error * specify "Connection: close" header when closing the connection * successful responses should keep the connection intact when otherwise is not requested by the client Modifications: * "send response and cleanup the connection" logic moved to a helper * for all successful responses set "Content-Lenght" header * do not specify "Connection: Keep-Alive" header as far it's a default for HTTP/1.1 * set "Connection: close" header when necessary Result: Keep-Alive connections management is inlined with RFCs.
b199ef6 to
ec9cb5e
Compare
normanmaurer
approved these changes
Mar 6, 2019
normanmaurer
pushed a commit
that referenced
this pull request
Mar 6, 2019
Motivation: Simple rules: * close the connection when sending any error * specify "Connection: close" header when closing the connection * successful responses should keep the connection intact when otherwise is not requested by the client Modifications: * "send response and cleanup the connection" logic moved to a helper * for all successful responses set "Content-Lenght" header * do not specify "Connection: Keep-Alive" header as far it's a default for HTTP/1.1 * set "Connection: close" header when necessary Result: Keep-Alive connections management is inlined with RFCs.
kachayev
added a commit
to kachayev/netty
that referenced
this pull request
Apr 2, 2019
Motivation: "Connection: close" header should be specified each time we're going to close an underlying TCP connection when sending HTTP/1.1 reply. Modifications: Introduces changes made in netty#8914 for the following examples: * WebSocket index page and WebSocket server handler * HelloWorld server * SPDY server handler * HTTP/1.1 server handler from HTTP/2 HelloWorld example * HTTP/1.1 server handler from tiles example Result: Keep-Alive connections management conforms with RFCs.
normanmaurer
pushed a commit
that referenced
this pull request
Apr 2, 2019
…8966) Motivation: "Connection: close" header should be specified each time we're going to close an underlying TCP connection when sending HTTP/1.1 reply. Modifications: Introduces changes made in #8914 for the following examples: * WebSocket index page and WebSocket server handler * HelloWorld server * SPDY server handler * HTTP/1.1 server handler from HTTP/2 HelloWorld example * HTTP/1.1 server handler from tiles example Result: Keep-Alive connections management conforms with RFCs.
normanmaurer
pushed a commit
that referenced
this pull request
Apr 2, 2019
…8966) Motivation: "Connection: close" header should be specified each time we're going to close an underlying TCP connection when sending HTTP/1.1 reply. Modifications: Introduces changes made in #8914 for the following examples: * WebSocket index page and WebSocket server handler * HelloWorld server * SPDY server handler * HTTP/1.1 server handler from HTTP/2 HelloWorld example * HTTP/1.1 server handler from tiles example Result: Keep-Alive connections management conforms with RFCs.
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.
Motivation:
Simple rules:
Modifications:
Result:
Keep-Alive connections management conforms with RFCs.