diff --git a/ChangeLog b/ChangeLog index 02e3cc6ca6..b3cd1585fa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sat Sep 26 13:26:55 2009 Marc-Andre Lafortune + + * 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 * 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)