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

Define UNPACK_TCP_STATE_FROM_TCP_INFO in the right place #2588

Merged
merged 1 commit into from Apr 2, 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
4 changes: 2 additions & 2 deletions lib/puma/server.rb
Expand Up @@ -137,8 +137,6 @@ def closed_socket_supported?
# socket parameter may be an MiniSSL::Socket, so use to_io
#
if tcp_cork_supported?
UNPACK_TCP_STATE_FROM_TCP_INFO = "C".freeze

# 6 == Socket::IPPROTO_TCP
# 3 == TCP_CORK
# 1/0 == turn on/off
Expand Down Expand Up @@ -168,6 +166,8 @@ def uncork_socket(socket)
end

if closed_socket_supported?
UNPACK_TCP_STATE_FROM_TCP_INFO = "C".freeze

def closed_socket?(socket)
return false unless socket.kind_of? TCPSocket
return false unless @precheck_closing
Expand Down