diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/net/http.rb | 4 |
2 files changed, 9 insertions, 0 deletions
@@ -1,3 +1,8 @@ +Sat Sep 26 13:26:55 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] + Sat Sep 26 08:35:12 2009 Koichi Sasada <ko1@atdot.net> * iseq.c (compile_string): rename to parse_string(), because 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) |