mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/net-http] Revert "Replace Timeout.timeout in Net:HTTP#connect"
This reverts commit753cae3bbc
.98caa38204
This commit is contained in:
parent
e026368061
commit
f88bff7705
1 changed files with 8 additions and 7 deletions
|
@ -1013,13 +1013,14 @@ module Net #:nodoc:
|
||||||
end
|
end
|
||||||
|
|
||||||
debug "opening connection to #{conn_addr}:#{conn_port}..."
|
debug "opening connection to #{conn_addr}:#{conn_port}..."
|
||||||
|
s = Timeout.timeout(@open_timeout, Net::OpenTimeout) {
|
||||||
begin
|
begin
|
||||||
s = Socket.tcp conn_addr, conn_port, @local_host, @local_port, connect_timeout: @open_timeout
|
TCPSocket.open(conn_addr, conn_port, @local_host, @local_port)
|
||||||
rescue => e
|
rescue => e
|
||||||
e = Net::OpenTimeout.new(e) if e.is_a?(Errno::ETIMEDOUT) #for compatibility with previous versions
|
|
||||||
raise e, "Failed to open TCP connection to " +
|
raise e, "Failed to open TCP connection to " +
|
||||||
"#{conn_addr}:#{conn_port} (#{e.message})"
|
"#{conn_addr}:#{conn_port} (#{e.message})"
|
||||||
end
|
end
|
||||||
|
}
|
||||||
s.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1)
|
s.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1)
|
||||||
debug "opened"
|
debug "opened"
|
||||||
if use_ssl?
|
if use_ssl?
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue