From 84c03d4019493edcd1c59e2816fbea08f3375c92 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 27 Feb 2010 17:58:16 -0800 Subject: TCPSocket#peeraddr may raise ENOTCONN Since we deal with untrusted/non-local clients, those clients may disconnect at inopportune times and leave us with ENOTCONN when we try to call getpeername(2) --- lib/rainbows/error.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/rainbows/error.rb') diff --git a/lib/rainbows/error.rb b/lib/rainbows/error.rb index e67d2e4..d90dad0 100644 --- a/lib/rainbows/error.rb +++ b/lib/rainbows/error.rb @@ -28,7 +28,8 @@ module Rainbows def response(e) case e - when EOFError,Errno::ECONNRESET,Errno::EPIPE,Errno::EINVAL,Errno::EBADF + when EOFError, Errno::ECONNRESET, Errno::EPIPE, Errno::EINVAL, + Errno::EBADF, Errno::ENOTCONN # swallow error if client shuts down one end or disconnects when Unicorn::HttpParserError Const::ERROR_400_RESPONSE # try to tell the client they're bad -- cgit v1.2.3-24-ge0c7