Open eduardvercaemer opened 3 months ago
The "issue" here is that ApacheBench is sending an HTTP/1.0
request. It seems like that doesn't support keep-alive
. I'll need to handle this particular case (and likely others with HTTP 1.0).
It's definitely not how it should be behaving, but I doubt many things are issuing requests with that version at this point. I'll definitely fix it, but it shouldn't be a problem with basically any other thing.
Thanks for the issue!
SO the first thing I tried was to use
ab
to test a simple ping server from an example.Turns out each request was always taking 10 seconds to complete. I dug into the code and found out the reason. Without explicitly doing
|> response.set_header("connection", "close")
on each request, the connection will be closed on a timeout of 10 seconds.Is there a reason for this ? It definitely threw me off for a while since it is not mentioned anywhere.
Relevant code: https://github.com/rawhat/mist/blob/master/src/mist/internal/http/handler.gleam