diff options
author | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-09-26 04:27:07 +0000 |
---|---|---|
committer | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-09-26 04:27:07 +0000 |
commit | 3a4e1d768d67f10c75178730b28d59d6cca732c4 (patch) | |
tree | 745f1ba1ceb379d21be0d53b07a0a4a1b928ee1a /lib | |
parent | dd7490d50d77d4f58a5282106accc676d2dfe25a (diff) | |
download | ruby-3a4e1d768d67f10c75178730b28d59d6cca732c4.tar.gz |
* lib/net/http.rb (transport_request): Handle timeout error by closing socket if exception raised. [ruby-core:20976]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/net/http.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/net/http.rb b/lib/net/http.rb index 512391b19f..64dbef4cbb 100644 --- a/lib/net/http.rb +++ b/lib/net/http.rb @@ -1124,6 +1124,10 @@ module Net #:nodoc: } end_transport req, res res + rescue => exception + D "Conn close because of error #{exception}" + @socket.close unless @socket.closed? + raise exception end def begin_transport(req) |