about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/unicorn.rb1
-rw-r--r--lib/unicorn/http_response.rb1
2 files changed, 1 insertions, 1 deletions
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
diff --git a/lib/unicorn/http_response.rb b/lib/unicorn/http_response.rb
index 6f1cd48..f3b5a82 100644
--- a/lib/unicorn/http_response.rb
+++ b/lib/unicorn/http_response.rb
@@ -63,7 +63,6 @@ module Unicorn::HttpResponse
     end
 
     body.each { |chunk| socket.write(chunk) }
-    socket.close # flushes and uncorks the socket immediately
     ensure
       body.respond_to?(:close) and body.close
   end