summary refs log tree commit homepage
diff options
authorEric Wong <>2012-04-27 11:48:16 -0700
committerEric Wong <>2012-04-27 11:48:16 -0700
commit04901da5ae0b4655c83be05d24ae737f1b572002 (patch)
parent8c1aff1e6335f8a55723907e2661dcb09ea16205 (diff)
Since there's nothing unicorn can do to avoid this error
on unconnected/halfway-connected clients, ignoring ENOTCONN
is a safe bet.

Rainbows! has long had this rescue as it called getpeername(2)
on untrusted sockets
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/unicorn/http_server.rb b/lib/unicorn/http_server.rb
index f942e2f..14a6f9a 100644
--- a/lib/unicorn/http_server.rb
+++ b/lib/unicorn/http_server.rb
@@ -507,7 +507,8 @@ class Unicorn::HttpServer
   # the socket is closed at the end of this function
   def handle_error(client, e)
     msg = case e
-    when EOFError,Errno::ECONNRESET,Errno::EPIPE,Errno::EINVAL,Errno::EBADF
+    when EOFError,Errno::ECONNRESET,Errno::EPIPE,Errno::EINVAL,Errno::EBADF,
+         Errno::ENOTCONN
     when Unicorn::RequestURITooLongError