Skip to content

Commit

Permalink
Handle ENOTCONN when shutting down client connection
Browse files Browse the repository at this point in the history
  • Loading branch information
byroot committed May 25, 2023
1 parent 5b575ca commit 1f113fa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/pitchfork/http_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,10 @@ def process_client(client)
end

unless client.closed? # rack.hijack may've close this for us
client.shutdown # in case of fork() in Rack app
begin
client.shutdown # in case of fork() in Rack app
rescue Errno::ENOTCONN
end
client.close # flush and uncork socket immediately, no keepalive
end
rescue => e
Expand Down

0 comments on commit 1f113fa

Please sign in to comment.