diff --git a/lib/puma/reactor.rb b/lib/puma/reactor.rb index 1883d9f9..ea44bd94 100644 --- a/lib/puma/reactor.rb +++ b/lib/puma/reactor.rb @@ -45,24 +45,17 @@ module Puma @app_pool << c sockets.delete c end + # The client doesn't know HTTP well rescue HttpParserError => e c.close sockets.delete c - if c.timeout_at - @timeouts.delete c - end - @events.parse_error @server, c.env, e - rescue EOFError => e + rescue IOError => e c.close sockets.delete c - - if c.timeout_at - @timeouts.delete c - end end end end diff --git a/lib/puma/server.rb b/lib/puma/server.rb index b168fad3..e4ae4b1b 100644 --- a/lib/puma/server.rb +++ b/lib/puma/server.rb @@ -208,7 +208,7 @@ module Puma rescue HttpParserError => e client.close @events.parse_error self, client.env, e - rescue EOFError + rescue IOError client.close else if process_now @@ -318,7 +318,7 @@ module Puma end # The client disconnected while we were reading data - rescue EOFError, SystemCallError => e + rescue IOError, SystemCallError => e # Swallow them. The ensure tries to close +client+ down # The client doesn't know HTTP well