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

ruby-changes:14882

From: akr <ko1@a...>
Date: Wed, 24 Feb 2010 22:47:20 +0900 (JST)
Subject: [ruby-changes:14882] Ruby:r26750 (ruby_1_8, trunk): * lib/resolv.rb: fix reported by Paul Clegg.

akr	2010-02-24 22:44:08 +0900 (Wed, 24 Feb 2010)

  New Revision: 26750

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

  Log:
    * lib/resolv.rb: fix [ruby-core:28320] reported by Paul Clegg.
      (Resolv::DNS::Requester#request): raise ResolvTimeout
      consistently for timeout.

  Modified files:
    branches/ruby_1_8/ChangeLog
    branches/ruby_1_8/lib/resolv.rb
    trunk/ChangeLog
    trunk/lib/resolv.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 26749)
+++ ChangeLog	(revision 26750)
@@ -1,3 +1,9 @@
+Wed Feb 24 22:39:15 2010  Tanaka Akira  <akr@f...>
+
+	* lib/resolv.rb: fix [ruby-core:28320] reported by Paul Clegg.
+	  (Resolv::DNS::Requester#request): raise ResolvTimeout
+	  consistently for timeout.
+
 Wed Feb 24 14:38:16 2010  Eric Hodel  <drbrain@s...>
 
 	* lib/rubygems/indexer: Removed obsolete files.
Index: lib/resolv.rb
===================================================================
--- lib/resolv.rb	(revision 26749)
+++ lib/resolv.rb	(revision 26750)
@@ -628,8 +628,12 @@
       def request(sender, tout)
         timelimit = Time.now + tout
         sender.send
-        while (now = Time.now) < timelimit
+        while true
+          now = Time.now
           timeout = timelimit - now
+          if timeout <= 0
+            raise ResolvTimeout
+          end
           select_result = IO.select(@socks, nil, nil, timeout)
           if !select_result
             raise ResolvTimeout
Index: ruby_1_8/ChangeLog
===================================================================
--- ruby_1_8/ChangeLog	(revision 26749)
+++ ruby_1_8/ChangeLog	(revision 26750)
@@ -1,3 +1,9 @@
+Wed Feb 24 22:39:15 2010  Tanaka Akira  <akr@f...>
+
+	* lib/resolv.rb: fix [ruby-core:28320] reported by Paul Clegg.
+	  (Resolv::DNS::Requester#request): raise ResolvTimeout consistently
+	  for timeout.
+
 Wed Feb 24 00:40:58 2010  Akinori MUSHA  <knu@i...>
 
 	* parse.y: Revert r26609, r26160, r25658 and r24695.  The loose
Index: ruby_1_8/lib/resolv.rb
===================================================================
--- ruby_1_8/lib/resolv.rb	(revision 26749)
+++ ruby_1_8/lib/resolv.rb	(revision 26750)
@@ -621,8 +621,12 @@
       def request(sender, tout)
         timelimit = Time.now + tout
         sender.send
-        while (now = Time.now) < timelimit
+        while true
+          now = Time.now
           timeout = timelimit - now
+          if timeout <= 0
+            raise ResolvTimeout
+          end
           select_result = IO.select(@socks, nil, nil, timeout)
           if !select_result
             raise ResolvTimeout

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

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