From b7a0074284d33352bb9e732c660b29162f34bf0e Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 5 Jan 2011 23:05:05 -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 (cherry picked from commit b72a86f66c722d56a6d77ed1d2779ace6ad103ed) Conflicts: lib/unicorn/http_server.rb test/unit/test_response.rb --- lib/unicorn.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/unicorn.rb') diff --git a/lib/unicorn.rb b/lib/unicorn.rb index 735354f..31332c9 100644 --- a/lib/unicorn.rb +++ b/lib/unicorn.rb @@ -646,6 +646,7 @@ module Unicorn response = app.call(env) end HttpResponse.write(client, response, HttpRequest::PARSER.headers?) + client.close # flushes and uncorks the socket immediately, no keepalive rescue => e handle_error(client, e) end -- cgit v1.2.3-24-ge0c7