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

* lib/resolv.rb (Resolv::DNS#each_address): now returns IPv6 address.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2007-12-28 07:38:56 +00:00
parent c43f867852
commit 727d85c0e3
2 changed files with 14 additions and 3 deletions

View file

@ -1,3 +1,7 @@
Fri Dec 28 16:36:33 2007 NARUSE, Yui <naruse@airemix.com>
* lib/resolv.rb (Resolv::DNS#each_address): now returns IPv6 address.
Fri Dec 28 16:10:00 2007 Eric Hodel <drbrain@segment7.net>
* lib/rdoc/dot/dot.rb: Move to lib/rdoc/dot.rb. Fix namespacing.

View file

@ -28,7 +28,6 @@ require 'thread'
#
# * NIS is not supported.
# * /etc/nsswitch.conf is not supported.
# * IPv6 is not supported.
class Resolv
@ -388,7 +387,16 @@ class Resolv
# be a Resolv::IPv4 or Resolv::IPv6
def each_address(name)
each_resource(name, Resource::IN::A) {|resource| yield resource.address}
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}
end
##
@ -445,7 +453,6 @@ class Resolv
# * Resolv::DNS::Resource::IN::A
# * Resolv::DNS::Resource::IN::AAAA
# * Resolv::DNS::Resource::IN::ANY
# * Resolv::DNS::Resource::IN::ANY
# * Resolv::DNS::Resource::IN::CNAME
# * Resolv::DNS::Resource::IN::HINFO
# * Resolv::DNS::Resource::IN::MINFO