summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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