Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server#closed_socket? - parameter may be a MiniSSL::Socket #2596

Merged
merged 1 commit into from Apr 18, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/puma/server.rb
Expand Up @@ -169,11 +169,11 @@ def uncork_socket(socket)
UNPACK_TCP_STATE_FROM_TCP_INFO = "C".freeze

def closed_socket?(socket)
return false unless socket.kind_of? TCPSocket
return false unless @precheck_closing
skt = socket.to_io
return false unless skt.kind_of?(TCPSocket) && @precheck_closing

begin
tcp_info = socket.getsockopt(Socket::IPPROTO_TCP, Socket::TCP_INFO)
tcp_info = skt.getsockopt(Socket::IPPROTO_TCP, Socket::TCP_INFO)
rescue IOError, SystemCallError
Thread.current.purge_interrupt_queue if Thread.current.respond_to? :purge_interrupt_queue
@precheck_closing = false
Expand Down