Skip to content

Commit

Permalink
Be sure to cleanup and close bad client sockets
Browse files Browse the repository at this point in the history
  • Loading branch information
evanphx committed Jul 24, 2012
1 parent 44c8c1a commit e13d9ba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/puma/reactor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ def run
end
# The client doesn't know HTTP well
rescue HttpParserError => e
c.close
sockets.delete c

@events.parse_error @server, c.env, e

rescue EOFError
Expand Down
1 change: 1 addition & 0 deletions lib/puma/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ def run(background=true)
begin
process_now = client.eagerly_finish
rescue HttpParserError => e
client.close
@events.parse_error self, client.env, e
rescue EOFError
client.close
Expand Down

0 comments on commit e13d9ba

Please sign in to comment.