We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e376022 commit 738c06fCopy full SHA for 738c06f
lib/net/protocol.rb
@@ -54,6 +54,16 @@ def ssl_socket_connect(s, timeout)
54
s.connect
55
end
56
57
+
58
+ tcp_socket_parameters = TCPSocket.instance_method(:initialize).parameters
59
+ TCP_SOCKET_NEW_HAS_OPEN_TIMEOUT = if tcp_socket_parameters != [[:rest]]
60
+ tcp_socket_parameters.include?([:key, :open_timeout])
61
+ else
62
+ # Use Socket.tcp to find out since there is no parameters information for TCPSocket#initialize
63
+ # See discussion in https://github.com/ruby/net-http/pull/224
64
+ Socket.method(:tcp).parameters.include?([:key, :open_timeout])
65
+ end
66
+ private_constant :TCP_SOCKET_NEW_HAS_OPEN_TIMEOUT
67
68
69
0 commit comments