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