From b01b43d1da92348bc31421005808a78892144afc Mon Sep 17 00:00:00 2001 From: Evan Phoenix Date: Sat, 25 Jan 2014 19:32:54 -0800 Subject: [PATCH] Rescue SystemCallError as well. Fixes #425 --- lib/puma/server.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/puma/server.rb b/lib/puma/server.rb index 6fc183f5..9eb7d77b 100644 --- a/lib/puma/server.rb +++ b/lib/puma/server.rb @@ -102,13 +102,16 @@ module Puma # 3 == TCP_CORK # 1/0 == turn on/off def cork_socket(socket) - socket.setsockopt(6, 3, 1) if socket.kind_of? TCPSocket + begin + socket.setsockopt(6, 3, 1) if socket.kind_of? TCPSocket + rescue IOError, SystemCallError + end end def uncork_socket(socket) begin socket.setsockopt(6, 3, 0) if socket.kind_of? TCPSocket - rescue IOError + rescue IOError, SystemCallError end end else