Skip to content

Commit

Permalink
Added the ability to process the results of passing through a request.
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Williams authored and Samuel Williams committed Sep 4, 2009
1 parent 378a923 commit 7310fa4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build/gemspec.master
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Dir.chdir("../") do
Gem::Specification.new do |s|
s.name = "RubyDNS"
s.version = "0.1.3"
s.version = "0.1.4"
s.date = "2009-09-04"
s.summary = "A simple DNS server DSL for Ruby."
s.homepage = "http://wiki.oriontransfer.org/code:rubydns.git"
Expand Down
9 changes: 8 additions & 1 deletion lib/rubydns/transaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,19 @@ def to_s
# the resolver and <tt>merge!</tt> the answer if one is received. If recursion is
# not requested, the result is <tt>failure!(:Refused)</tt>. If the resolver does
# not respond, the result is <tt>failure!(:NXDomain)</tt>
def passthrough! (resolver)
#
# If a block is supplied, this function yields with the reply and reply_name if
# successful. This could be used, for example, to update a cache.
def passthrough! (resolver, &block)
# Were we asked to recursively find this name?
if @query.rd
reply, reply_name = resolver.query(name, resource_class)

if reply
if block_given?
yield(reply, reply_name)
end

@answer.merge!(reply)
else
failure!(:NXDomain)
Expand Down

0 comments on commit 7310fa4

Please sign in to comment.