From f4005d5efc608e7d75371f0d0527041facd33f89 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 7 Nov 2013 20:10:01 +0000 Subject: stream_input: avoid IO#close on client disconnect 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 --- lib/unicorn/stream_input.rb | 5 +---- 1 file changed, 1 insertion(+), 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 ensure raise Unicorn::ClientShutdown, "bytes_read=#{@bytes_read}", [] end -- cgit v1.2.3-24-ge0c7