about summary refs log tree commit homepage
diff options
authorEric Wong <normalperson@yhbt.net>2013-11-07 20:10:01 +0000
committerEric Wong <normalperson@yhbt.net>2013-11-07 20:10:01 +0000
commitf4005d5efc608e7d75371f0d0527041facd33f89 (patch)
parenta1aa5c97289df09a90831c4d9bf6e22ac351bdd8 (diff)
This can avoid IOError from being seen by the application, and also
reduces points where IO#close may be called.  This is a good thing
if we eventually port this code into a low-level server like
cmogstored where per-client memory space is defined by FD number of
a client.

Reported-by: Andrew Hobson <ahobson@gmail.com>
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/unicorn/stream_input.rb b/lib/unicorn/stream_input.rb
index c8a4240..9278f47 100644
--- a/lib/unicorn/stream_input.rb
+++ b/lib/unicorn/stream_input.rb
@@ -139,10 +139,7 @@ private
     # we do support clients that shutdown(SHUT_WR) after the
     # _entire_ request has been sent, and those will not have
     # raised EOFError on us.
-    if @socket
-      @socket.shutdown
-      @socket.close
-    end
+    @socket.shutdown if @socket
     raise Unicorn::ClientShutdown, "bytes_read=#{@bytes_read}", []