Project

General

Profile

Feature #4788 » resolv_rb_patch.txt

method name updated - metanest (Makoto Kishimoto), 07/14/2011 03:46 PM

 
diff --git a/lib/resolv.rb b/lib/resolv.rb
index 1e18893..e9c2432 100644
--- a/lib/resolv.rb
+++ b/lib/resolv.rb
@@ -491,6 +491,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 = {}
@@ -517,7 +523,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
(2-2/2)