puma-simon 3.7.1 → 3.7.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: da87813135b854ec14615b89fa69b7309d0a9754
4
- data.tar.gz: 71bee09d8654ff891e7257531e1a0d7a4b389ed2
3
+ metadata.gz: '054908b8cd8cd59810255d001bc597d3f2070263'
4
+ data.tar.gz: 93611b3f19e40b1c3b0a417ef217c3fba63bb8db
5
5
  SHA512:
6
- metadata.gz: 4f804853d8752311e58708573c542b20c75ab3a113e35b0160c3e98d12cf3ce21c7e290f188d51716cc9f868f8a4ac8f2ab8bd7402af7615cb2b6bcb5c59dde2
7
- data.tar.gz: 976b89bc7f7955732bac8e5cc2e6e0559a1b3478db722b5e77cc5760edb8f84230f739d718373a900072483c1ecc98a54ecf1b30ce833997b1b4471bd2b3b34f
6
+ metadata.gz: bfa0b6ad51f592d90370c72004644241ec9d1314519e58c25607e51ce89b20663123bdb7eca7217799e62c1f1a804a9f8ce23b9be4f42c30f942aee5c723b9ba
7
+ data.tar.gz: eb009d2070825d8eb29f5fe1460192d022a672675bb19ee53668d6ecbbf9bd10d46925944d04808c23093e09bf5c96113d819cebf621a20b597e8870c7e77339
data/lib/puma/const.rb CHANGED
@@ -95,7 +95,7 @@ module Puma
95
95
  # too taxing on performance.
96
96
  module Const
97
97
 
98
- PUMA_VERSION = VERSION = "3.7.1".freeze
98
+ PUMA_VERSION = VERSION = "3.7.2".freeze
99
99
  CODE_NAME = "Snowy Sagebrush".freeze
100
100
  PUMA_SERVER_STRING = ['puma', PUMA_VERSION, CODE_NAME].join(' ').freeze
101
101
 
data/lib/puma/server.rb CHANGED
@@ -28,9 +28,6 @@ module Puma
28
28
  include Puma::Const
29
29
  extend Puma::Delegation
30
30
 
31
- # TCP_TIME_WAIT: 6, TCP_CLOSE: 7, TCP_CLOSE_WAIT: 8, TCP_LAST_ACK: 9
32
- IGNORED_CHECK_CLIENT_SOCKET_STATES = (6..9)
33
-
34
31
  attr_reader :thread
35
32
  attr_reader :events
36
33
  attr_accessor :app
@@ -103,6 +100,8 @@ module Puma
103
100
  # packetizes our stream. This improves both latency and throughput.
104
101
  #
105
102
  if RUBY_PLATFORM =~ /linux/
103
+ UNPACK_TCP_STATE_FROM_TCP_INFO = "C".freeze
104
+
106
105
  # 6 == Socket::IPPROTO_TCP
107
106
  # 3 == TCP_CORK
108
107
  # 1/0 == turn on/off
@@ -121,9 +120,11 @@ module Puma
121
120
  end
122
121
 
123
122
  def closed_socket?(socket)
123
+ return false unless socket.kind_of? TCPSocket
124
124
  tcp_info = socket.getsockopt(Socket::SOL_TCP, Socket::TCP_INFO)
125
- state = tcp_info.unpack("C".freeze)[0]
126
- IGNORED_CHECK_CLIENT_SOCKET_STATES.cover?(state)
125
+ state = tcp_info.unpack(UNPACK_TCP_STATE_FROM_TCP_INFO)[0]
126
+ # TIME_WAIT: 6, CLOSE: 7, CLOSE_WAIT: 8, LAST_ACK: 9, CLOSING: 11
127
+ (state >= 6 && state <= 9) || state == 11
127
128
  end
128
129
  else
129
130
  def cork_socket(socket)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puma-simon
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.7.1
4
+ version: 3.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Phoenix