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

Define UNPACK_TCP_STATE_FROM_TCP_INFO in the right place (#2588)

This fixes the issue for me when I run Puma in FreeBSD using Vagrant.

Close https://github.com/puma/puma/issues/2556
This commit is contained in:
Patrik Ragnarsson 2021-04-02 02:20:39 +02:00 committed by GitHub
parent 403975b372
commit 15b0794392
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -137,8 +137,6 @@ module Puma
# 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
@ -168,6 +166,8 @@ module Puma
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