summaryrefslogtreecommitdiff
path: root/lib/net
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-04-23 13:48:31 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-04-23 13:48:31 +0000
commit7255d93b08909a0117840083322dc27d5568c423 (patch)
tree1fd6927d747873fe7bda4a24202c7f7a5e7c254a /lib/net
parent146aff91c43bf19f753a928410f9e55b2a17868f (diff)
deal with timeout exceptions
* lib/net/http.rb (Net::HTTP#transport_request): deal with Net::OpenTimeout and Net::ReadTimeout first to get rid of loading OpenSSL as possible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/net')
-rw-r--r--lib/net/http.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/net/http.rb b/lib/net/http.rb
index 03a65ab88b..7343762564 100644
--- a/lib/net/http.rb
+++ b/lib/net/http.rb
@@ -1357,11 +1357,11 @@ module Net #:nodoc:
}
res
}
- rescue IOError, EOFError,
+ rescue Net::OpenTimeout
+ raise
+ rescue Net::ReadTimeout, IOError, EOFError,
Errno::ECONNRESET, Errno::ECONNABORTED, Errno::EPIPE,
OpenSSL::SSL::SSLError, Timeout::Error => exception
- raise if Net::OpenTimeout === exception
-
if count == 0 && IDEMPOTENT_METHODS_.include?(req.method)
count += 1
@socket.close if @socket and not @socket.closed?