From 3a4e1d768d67f10c75178730b28d59d6cca732c4 Mon Sep 17 00:00:00 2001 From: marcandre Date: Sat, 26 Sep 2009 04:27:07 +0000 Subject: [PATCH] * 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/trunk@25097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ lib/net/http.rb | 4 ++++ 2 files changed, 9 insertions(+) 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)