-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
HTTP/1.0 and keep-alive bug #1614
Copy link
Copy link
Closed
Labels
A-http1Area: HTTP/1 specific.Area: HTTP/1 specific.C-bugCategory: bug. Something is wrong. This is bad!Category: bug. Something is wrong. This is bad!E-easyEffort: easy. A task that would be a great starting point for a new contributor.Effort: easy. A task that would be a great starting point for a new contributor.
Description
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 uses HTTP/1.0 requests. It sends a Connection: keep-alive header, and hyper does keep the connection alive, but it does not add a Connection: 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 result ab hangs.
Hyper should probably add a Connection: keep-alive header to the response if it is found in the request, the request protocol is HTTP/1.0 and there's no Connection header in the Response object present yet.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-http1Area: HTTP/1 specific.Area: HTTP/1 specific.C-bugCategory: bug. Something is wrong. This is bad!Category: bug. Something is wrong. This is bad!E-easyEffort: easy. A task that would be a great starting point for a new contributor.Effort: easy. A task that would be a great starting point for a new contributor.