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 | |
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
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/resolv.rb | 12 |
2 files changed, 7 insertions, 10 deletions
@@ -1,3 +1,8 @@ +Sun Jan 6 00:48:12 2008 NARUSE, Yui <naruse@ruby-lang.org> + + * lib/resolv.rb (Reolv::DNS#each_address): get A record and then AAAA + record. [ruby-dev:32925] + Sat Jan 5 21:48:03 2008 Tanaka Akira <akr@fsij.org> * vm_insnhelper.c (vm_callee_setup_arg): it is not inlinable because 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 ## |