summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-22 13:31:52 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-22 13:31:52 +0000
commit8dbacbfefcdf44400f50fc1768317cd514fe20bd (patch)
treea3ec9c2ccf4239d3bfa752b74d5b7b05947bf086 /lib
parenta733f8f5ae777e7f89452be6a6198ca254ddda17 (diff)
merge revision(s) 26750:
* lib/resolv.rb: fix [ruby-core:28320] reported by Paul Clegg. (Resolv::DNS::Requester#request): raise ResolvTimeout consistently for timeout. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@27960 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/resolv.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/resolv.rb b/lib/resolv.rb
index b9a2174191..5a4275f63a 100644
--- a/lib/resolv.rb
+++ b/lib/resolv.rb
@@ -611,8 +611,12 @@ class Resolv
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