-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTTP/1.0 and keep-alive bug #1614
Comments
Yikes, you're right! Seems there's two parts to this bug:
Probably the best place to do this is in |
Change behaviour of connection or server response when the request is version 1.0 and the Connection: keep-alive header is not present. 1. If the response is also version 1.0, then connection is closed if the server keep-alive header is not present. 2. If the response is version 1.1, then the keep-alive header is added when downgrading to version 1.0. CLOSES: hyperium#1614
Change behaviour of connection or server response when the request is version 1.0 and the Connection: keep-alive header is not present. 1. If the response is also version 1.0, then connection is closed if the server keep-alive header is not present. 2. If the response is version 1.1, then the keep-alive header is added when downgrading to version 1.0. CLOSES: hyperium#1614
Change behaviour of connection or server response when the request is version 1.0 and the Connection: keep-alive header is not present. 1. If the response is also version 1.0, then connection is closed if the server keep-alive header is not present. 2. If the response is version 1.1, then the keep-alive header is added when downgrading to version 1.0. CLOSES: hyperium#1614
PR #1634 should fix this. Here is a comparison of the before change
after change
|
Change behaviour of connection or server response when the request is version 1.0 and the Connection: keep-alive header is not present. 1. If the response is also version 1.0, then connection is closed if the server keep-alive header is not present. 2. If the response is version 1.1, then the keep-alive header is added when downgrading to version 1.0. Closes #1614
I was testing my hyper-based server with
ab
(Apache Bench) and it turns out that if you enable the-k
(keepalive) option,ab
just hangs.Turns out that
ab
usesHTTP/1.0
requests. It sends aConnection: keep-alive
header, and hyper does keep the connection alive, but it does not add aConnection: keep-alive
header to the reply.ab
assumes that the server does not support keep-alive, and waits for the server to close the connection, and as a resultab
hangs.Hyper should probably add a
Connection: keep-alive
header to the response if it is found in the request, the request protocol isHTTP/1.0
and there's noConnection
header in the Response object present yet.The text was updated successfully, but these errors were encountered: