summaryrefslogtreecommitdiff
path: root/lib/net/smtp.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-28 05:15:54 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-28 05:15:54 +0000
commit09f27873ed653bd4afb5538b669e2362f3b1bf6e (patch)
tree1dab78cb5c936ea9c4ee349e7415617e96371c8a /lib/net/smtp.rb
parent8a7da58c0fe28af09ce0631d6ada79e47cc7b98f (diff)
* lib/net/protocol.rb: Add OpenTimeout subclass of Timeout::Error
* lib/net/pop.rb: Modernize Timeout usage. Patch by Eric Wong. Use Net::OpenTimeout instead of Timeout::Error. [Bug #5765] * lib/net/http.rb: ditto * lib/net/smtp.rb: ditto * lib/net/telnet.rb: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34843 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/net/smtp.rb')
-rw-r--r--lib/net/smtp.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/net/smtp.rb b/lib/net/smtp.rb
index eaa010115f..2d4c0eae6d 100644
--- a/lib/net/smtp.rb
+++ b/lib/net/smtp.rb
@@ -546,7 +546,9 @@ module Net
check_auth_method(authtype || DEFAULT_AUTH_TYPE)
check_auth_args user, secret
end
- s = timeout(@open_timeout) { tcp_socket(@address, @port) }
+ s = Timeout.timeout(@open_timeout, Net::OpenTimeout) do
+ tcp_socket(@address, @port)
+ end
logging "Connection opened: #{@address}:#{@port}"
@socket = new_internet_message_io(tls? ? tlsconnect(s) : s)
check_response critical { recv_response() }