ruby-changes:16011
From: shyouhei <ko1@a...>
Date: Sat, 22 May 2010 22:32:40 +0900 (JST)
Subject: [ruby-changes:16011] Ruby:r27960 (ruby_1_8_7): merge revision(s) 26750:
shyouhei 2010-05-22 22:31:52 +0900 (Sat, 22 May 2010) New Revision: 27960 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=27960 Log: merge revision(s) 26750: * 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_7/ChangeLog branches/ruby_1_8_7/lib/resolv.rb branches/ruby_1_8_7/version.h Index: ruby_1_8_7/ChangeLog =================================================================== --- ruby_1_8_7/ChangeLog (revision 27959) +++ ruby_1_8_7/ChangeLog (revision 27960) @@ -1,3 +1,9 @@ +Sat May 22 22:31:36 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. + Sat May 22 22:14:11 2010 NARUSE, Yui <naruse@r...> * ext/readline/readline.c (Init_readline): initialize Index: ruby_1_8_7/version.h =================================================================== --- ruby_1_8_7/version.h (revision 27959) +++ ruby_1_8_7/version.h (revision 27960) @@ -2,7 +2,7 @@ #define RUBY_RELEASE_DATE "2010-05-22" #define RUBY_VERSION_CODE 187 #define RUBY_RELEASE_CODE 20100522 -#define RUBY_PATCHLEVEL 264 +#define RUBY_PATCHLEVEL 265 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 8 Index: ruby_1_8_7/lib/resolv.rb =================================================================== --- ruby_1_8_7/lib/resolv.rb (revision 27959) +++ ruby_1_8_7/lib/resolv.rb (revision 27960) @@ -611,8 +611,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/