I'm doing some testing with a server that returns 204 no content. I've implemented the test server in scotty and snap and for both, http-streams hangs indefinitely on 204 responses with no content. Here's a minimal example:
Just for fun, I made another server in Ruby's sinatra library to return a 204. http-streams handled it fine. I hit both with curl and saw this difference:
ruby:
* Adding handle: conn: 0xc46de0
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0xc46de0) send_pipe: 1, recv_pipe: 0
* About to connect() to localhost port 4567 (#0)
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 4567 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.30.0
> Host: localhost:4567
> Accept: */*
>
< HTTP/1.1 204 No Content
< X-Content-Type-Options: nosniff
< Connection: close
* Server thin 1.5.1 codename Straight Razor is not blacklisted
< Server: thin 1.5.1 codename Straight Razor
<
* Closing connection 0
scotty:
* Adding handle: conn: 0x76ade0
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x76ade0) send_pipe: 1, recv_pipe: 0
* About to connect() to localhost port 4568 (#0)
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 4568 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.30.0
> Host: localhost:4568
> Accept: */*
>
< HTTP/1.1 204 No Content
* Server Warp/1.3.8 is not blacklisted
< Server: Warp/1.3.8
<
* Connection #0 to host localhost left intact
I think the difference is that warp and snap are leaving the connection intact and http-streams isn't closing it?
I'm doing some testing with a server that returns 204 no content. I've implemented the test server in scotty and snap and for both, http-streams hangs indefinitely on 204 responses with no content. Here's a minimal example:
https://gist.github.com/MichaelXavier/5475167
Just for fun, I made another server in Ruby's sinatra library to return a 204. http-streams handled it fine. I hit both with curl and saw this difference:
I think the difference is that warp and snap are leaving the connection intact and http-streams isn't closing it?