* 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/trunk@26750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2010-02-24 13:44:08 +00:00
Родитель b2623d9bb8
Коммит aba5263254
2 изменённых файлов: 11 добавлений и 1 удалений

Просмотреть файл

@ -1,3 +1,9 @@
Wed Feb 24 22:39:15 2010 Tanaka Akira <akr@fsij.org>
* 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@segment7.net>
* lib/rubygems/indexer: Removed obsolete files.

Просмотреть файл

@ -628,8 +628,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