jacksonh / manos

Manos is an easy to use, easy to test, high performance web application framework that stays out of your way and makes your life ridiculously simple.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Processing of further requests over a single connection hangs in certain situations.

zygfryd opened this issue · comments

I've noticed that sometimes refreshing my manos-served pages resulted in browsers waiting for the server to respond until timing out. As far as my testing revealed, it happens randomly on keep-alive connections when using non-chunked responses with SendFile, and consistently on the first connection of a newly started manos app after any non-chunked response is returned (even empty). It happens only when connecting locally, remote connections seem to be unaffected.
Tested on mono 2.8.2 and 2.10 on gentoo/amd64, with manos a3d19af.

Testcase:
Get ("/foo", ctx => { ctx.Response.Stream.Chunked = false; ctx.Response.End(); });

curl -s -v -H'Connection: keep-alive' http://127.0.0.1:8080/foo -o /dev/null http://127.0.0.1:8080/foo -o /dev/null http://127.0.0.1:8080/foo -o /dev/null

Output:
* About to connect() to 127.0.0.1 port 8080 (#0)
* Trying 127.0.0.1... connected
* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)
> GET /foo HTTP/1.1
> User-Agent: curl/7.21.2 (x86_64-pc-linux-gnu) libcurl/7.21.2 GnuTLS/2.6.5 zlib/1.2.3
> Host: 127.0.0.1:8080
> Accept: /
> Connection: keep-alive
>
< HTTP/1.1 200 OK
< Content-Length: 0
<
{ [data not shown]
* Connection #0 to host 127.0.0.1 left intact
* Re-using existing connection! (#0) with host 127.0.0.1
* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)
> GET /foo HTTP/1.1
> User-Agent: curl/7.21.2 (x86_64-pc-linux-gnu) libcurl/7.21.2 GnuTLS/2.6.5 zlib/1.2.3
> Host: 127.0.0.1:8080
> Accept: /
> Connection: keep-alive
>
[hangs here] * Connection died, retrying a fresh connect