From b72a86f66c722d56a6d77ed1d2779ace6ad103ed Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 5 Jan 2011 22:39:03 -0800 Subject: close client socket after closing response body Response bodies may capture the block passed to each and save it for body.close, so don't close the socket before we have a chance to call body.close --- lib/unicorn/http_server.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/unicorn/http_server.rb') diff --git a/lib/unicorn/http_server.rb b/lib/unicorn/http_server.rb index e2a4db7..3a6e51e 100644 --- a/lib/unicorn/http_server.rb +++ b/lib/unicorn/http_server.rb @@ -538,6 +538,7 @@ class Unicorn::HttpServer end @request.headers? or headers = nil http_response_write(client, status, headers, body) + client.close # flush and uncork socket immediately, no keepalive rescue => e handle_error(client, e) end -- cgit v1.2.3-24-ge0c7