diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-05 15:53:35 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-05 15:53:35 +0000 |
commit | 2435067f6ca2486570d3b90102b1a0ebe13cb1ea (patch) | |
tree | 9e413f71902ae0f883792b27d8ff17a47bac41aa /lib/resolv.rb | |
parent | 7967e3e2f445444a08f99fbe6d53858dad2c9ae3 (diff) | |
download | ruby-2435067f6ca2486570d3b90102b1a0ebe13cb1ea.tar.gz |
* lib/resolv.rb (Reolv::DNS#each_address): get A record and then AAAA
record. [ruby-dev:32925]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/resolv.rb')
-rw-r--r-- | lib/resolv.rb | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/resolv.rb b/lib/resolv.rb index 5fcf6420f5..4c41e57ddb 100644 --- a/lib/resolv.rb +++ b/lib/resolv.rb @@ -387,16 +387,8 @@ class Resolv # be a Resolv::IPv4 or Resolv::IPv6 def each_address(name) - buf = [] - each_resource(name, Resource::IN::ANY) do |resource| - case resource.address - when Resolv::IPv4 - yield resource.address - when Resolv::IPv6 - buf << resource.address - end - end - buf.each {|resource| yield resource.address} + each_resource(name, Resource::IN::A) {|resource| yield resource.address} + each_resource(name, Resource::IN::AAAA) {|resource| yield resource.address} end ## |