1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

extract_resources uses each_resource instead of each_answer.

* lib/resolv.rb (Resolv::DNS#extract_resources): Use each_resource
  instead of each_answer.
  [ruby-core:75461] [Bug#12372] reported by Rafael Fernandez Lopez.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2016-11-05 08:33:03 +00:00
parent 0fe34211f2
commit 365c321585
2 changed files with 9 additions and 3 deletions

View file

@ -1,3 +1,9 @@
Sat Nov 5 17:29:06 2016 Tanaka Akira <akr@fsij.org>
* lib/resolv.rb (Resolv::DNS#extract_resources): Use each_resource
instead of each_answer.
[ruby-core:75461] [Bug#12372] reported by Rafael Fernandez Lopez.
Sat Nov 5 17:18:24 2016 NARUSE, Yui <naruse@ruby-lang.org>
* ext/-test/file/fs.c (get_atime_p): Updating of file access times

View file

@ -572,13 +572,13 @@ class Resolv
def extract_resources(msg, name, typeclass) # :nodoc:
if typeclass < Resource::ANY
n0 = Name.create(name)
msg.each_answer {|n, ttl, data|
msg.each_resource {|n, ttl, data|
yield data if n0 == n
}
end
yielded = false
n0 = Name.create(name)
msg.each_answer {|n, ttl, data|
msg.each_resource {|n, ttl, data|
if n0 == n
case data
when typeclass
@ -590,7 +590,7 @@ class Resolv
end
}
return if yielded
msg.each_answer {|n, ttl, data|
msg.each_resource {|n, ttl, data|
if n0 == n
case data
when typeclass