resolv_rb_patch.txt

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

Download (823 Bytes)

 
1
diff --git a/lib/resolv.rb b/lib/resolv.rb
2
index 1e18893..e9c2432 100644
3
--- a/lib/resolv.rb
4
+++ b/lib/resolv.rb
5
@@ -491,6 +491,12 @@ class Resolv
6
     # #getresource for argument details.
7
 
8
     def each_resource(name, typeclass, &proc)
9
+      fetch_resource(name, typeclass) {|reply, reply_name|
10
+        extract_resources(reply, reply_name, typeclass, &proc)
11
+      }
12
+    end
13
+
14
+    def fetch_resource(name, typeclass)
15
       lazy_initialize
16
       requester = make_udp_requester
17
       senders = {}
18
@@ -517,7 +523,7 @@ class Resolv
19
               # response will not fit in an untruncated UDP packet.
20
               redo
21
             else
22
-              extract_resources(reply, reply_name, typeclass, &proc)
23
+              yield(reply, reply_name)
24
             end
25
             return
26
           when RCode::NXDomain