Closed
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.