1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

Minor cleanup, use IOError instead of EOFError

This commit is contained in:
Evan Phoenix 2012-08-10 22:41:35 -07:00
parent dac774e74d
commit cd83b2f304
2 changed files with 4 additions and 11 deletions

View file

@ -45,24 +45,17 @@ module Puma
@app_pool << c @app_pool << c
sockets.delete c sockets.delete c
end end
# The client doesn't know HTTP well # The client doesn't know HTTP well
rescue HttpParserError => e rescue HttpParserError => e
c.close c.close
sockets.delete c sockets.delete c
if c.timeout_at
@timeouts.delete c
end
@events.parse_error @server, c.env, e @events.parse_error @server, c.env, e
rescue EOFError => e rescue IOError => e
c.close c.close
sockets.delete c sockets.delete c
if c.timeout_at
@timeouts.delete c
end
end end
end end
end end

View file

@ -208,7 +208,7 @@ module Puma
rescue HttpParserError => e rescue HttpParserError => e
client.close client.close
@events.parse_error self, client.env, e @events.parse_error self, client.env, e
rescue EOFError rescue IOError
client.close client.close
else else
if process_now if process_now
@ -318,7 +318,7 @@ module Puma
end end
# The client disconnected while we were reading data # 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 # Swallow them. The ensure tries to close +client+ down
# The client doesn't know HTTP well # The client doesn't know HTTP well