[前][次][番号順一覧][スレッド一覧]

ruby-changes:13334

From: marcandre <ko1@a...>
Date: Sat, 26 Sep 2009 13:34:12 +0900 (JST)
Subject: [ruby-changes:13334] Ruby:r25098 (ruby_1_8): * lib/net/http.rb (transport_request): Handle timeout error by closing socket if exception raised.

marcandre	2009-09-26 13:33:59 +0900 (Sat, 26 Sep 2009)

  New Revision: 25098

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=25098

  Log:
    * lib/net/http.rb (transport_request): Handle timeout error by closing socket if exception raised. [ruby-core:20976]

  Modified files:
    branches/ruby_1_8/ChangeLog
    branches/ruby_1_8/lib/net/http.rb

Index: ruby_1_8/ChangeLog
===================================================================
--- ruby_1_8/ChangeLog	(revision 25097)
+++ ruby_1_8/ChangeLog	(revision 25098)
@@ -1,3 +1,8 @@
+Sat Sep 26 13:32:00 2009  Marc-Andre Lafortune  <ruby-core@m...>
+
+	* 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@m...>
 
 	* lib/rational.rb (#+, #-, #/, #**, #<=>): Return correct error
Index: ruby_1_8/lib/net/http.rb
===================================================================
--- ruby_1_8/lib/net/http.rb	(revision 25097)
+++ ruby_1_8/lib/net/http.rb	(revision 25098)
@@ -1055,6 +1055,10 @@
       end_transport req, res
 
       res
+    rescue => exception
+      D "Conn close because of error #{exception}"
+      @socket.close unless @socket.closed?
+      raise exception
     end
 
     private

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]