summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authormarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-09-26 04:33:59 +0000
committermarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-09-26 04:33:59 +0000
commit8cdc1fca44820b3152286130bf6db930e3758b8b (patch)
tree4eef4cffc7e43ab7dda03a7c9405b25444ac787d /lib
parent4460a5e1605c1438043fc6004442c17c241f23e2 (diff)
* 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/branches/ruby_1_8@25098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/net/http.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/net/http.rb b/lib/net/http.rb
index a9ff60d663..11c0bad2b2 100644
--- a/lib/net/http.rb
+++ b/lib/net/http.rb
@@ -1055,6 +1055,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
private