ruby-changes:23386
From: nobu <ko1@a...>
Date: Mon, 23 Apr 2012 22:48:46 +0900 (JST)
Subject: [ruby-changes:23386] nobu:r35437 (trunk): deal with timeout exceptions
nobu 2012-04-23 22:48:31 +0900 (Mon, 23 Apr 2012) New Revision: 35437 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=35437 Log: 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. Modified files: trunk/lib/net/http.rb Index: lib/net/http.rb =================================================================== --- lib/net/http.rb (revision 35436) +++ lib/net/http.rb (revision 35437) @@ -1357,11 +1357,11 @@ } 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? -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/