summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-04-10 05:13:15 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-04-10 05:13:15 +0000
commit495e46a2b07944c984ae417a5c93431c79ff6228 (patch)
treeb077c36b7723638556f7193d042992dd325b2e41
parentda277e53d3ec40b286f80929662486866dba8d9d (diff)
* lib/resolv.rb (Resolv::DNS#each_address): backport from 1.9 for
CNAME. [ruby-dev:34200] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@15946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--lib/resolv.rb12
2 files changed, 7 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 5a3f7e3..94a6ffa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Apr 10 14:00:44 2008 Tanaka Akira <akr@fsij.org>
+
+ * lib/resolv.rb (Resolv::DNS#each_address): backport from 1.9 for
+ CNAME. [ruby-dev:34200]
+
Thu Apr 10 01:42:25 2008 NAKAMURA Usaku <usa@ruby-lang.org>
* enum.c (iterate_method): add prototype to avoid warning on VC++.
diff --git a/lib/resolv.rb b/lib/resolv.rb
index d4c2eb4..08f80e0 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
##