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.fetch_resource): New method to obtain

full result.
  [ruby-dev:43587] [Feature #4788] proposed by Makoto Kishimoto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40159 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2013-04-06 13:16:36 +00:00
parent d818a6ab40
commit 4c1e97226f
3 changed files with 17 additions and 1 deletions

View file

@ -1,3 +1,9 @@
Sat Apr 6 22:12:01 2013 Tanaka Akira <akr@fsij.org>
* lib/resolv.rb (Resolv::DNS.fetch_resource): New method to obtain
full result.
[ruby-dev:43587] [Feature #4788] proposed by Makoto Kishimoto.
Sat Apr 6 20:17:51 2013 Tanaka Akira <akr@fsij.org>
* ext/socket/socket.c (rsock_sys_fail_raddrinfo): Renamed from

4
NEWS
View file

@ -46,6 +46,10 @@ with all sufficient information, see the ChangeLog file.
* Pathname#write
* Pathname#binwrite
* Resolv
* New methods:
* Resolv::DNS.fetch_resource
* Rinda::RingServer, Rinda::RingFinger
* Rinda now supports multicast sockets. See Rinda::RingServer and
Rinda::RingFinger for details.

View file

@ -506,6 +506,12 @@ class Resolv
# #getresource for argument details.
def each_resource(name, typeclass, &proc)
fetch_resource(name, typeclass) {|reply, reply_name|
extract_resources(reply, reply_name, typeclass, &proc)
}
end
def fetch_resource(name, typeclass)
lazy_initialize
requester = make_udp_requester
senders = {}
@ -532,7 +538,7 @@ class Resolv
# response will not fit in an untruncated UDP packet.
redo
else
extract_resources(reply, reply_name, typeclass, &proc)
yield(reply, reply_name)
end
return
when RCode::NXDomain