summaryrefslogtreecommitdiff
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
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
-rw-r--r--ChangeLog5
-rw-r--r--lib/net/http.rb4
2 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 5b5558c270..82423db97c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sat Sep 26 13:32:00 2009 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * lib/net/http.rb (transport_request): Handle timeout error by
+ closing socket if exception raised. [ruby-core:20976]
+
Fri Sep 25 04:34:08 2009 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
* lib/rational.rb (#+, #-, #/, #**, #<=>): Return correct error
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