summaryrefslogtreecommitdiff
path: root/lib/net/pop.rb
diff options
context:
space:
mode:
authorglass <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-31 01:09:30 +0000
committerglass <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-31 01:09:30 +0000
commitc5e8627f658c88b2403e7b20637cf25e31feff88 (patch)
tree0f2b153ac4fb185912f23f4ce60c5c2f99f28d0d /lib/net/pop.rb
parent69a1db96fe63ff3071cb3d272675a1d0470aab01 (diff)
Revert "lib/net/http.rb: use connect_timeout instead of Timeout"
This reverts commit 69a1db96fe63ff3071cb3d272675a1d0470aab01. getaddrinfo(3) doesn't support timeout. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66660 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/net/pop.rb')
-rw-r--r--lib/net/pop.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/net/pop.rb b/lib/net/pop.rb
index f3009f9926..a6374cd78c 100644
--- a/lib/net/pop.rb
+++ b/lib/net/pop.rb
@@ -541,10 +541,8 @@ module Net
# internal method for Net::POP3.start
def do_start(account, password) # :nodoc:
- begin
- s = Socket.tcp(@address, port, connect_timeout: @open_timeout)
- rescue Errno::ETIMEDOUT
- raise Net::OpenTimeout, "execution expired"
+ s = Timeout.timeout(@open_timeout, Net::OpenTimeout) do
+ TCPSocket.open(@address, port)
end
if use_ssl?
raise 'openssl library not installed' unless defined?(OpenSSL)