From 09f27873ed653bd4afb5538b669e2362f3b1bf6e Mon Sep 17 00:00:00 2001 From: drbrain Date: Tue, 28 Feb 2012 05:15:54 +0000 Subject: * 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 --- lib/net/smtp.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/net/smtp.rb') 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() } -- cgit v1.2.3