[net-dns-users] AXFR (was: Re: sep() and is_sep())

Calle Dybedahl calle at init.se
Tue Jun 3 14:18:02 UTC 2014


On 3 jun 2014, at 15:46, Dick Franks <rwfranks at acm.org> wrote:

> 
> Internal method (and it *is* very obviously that) should never have had POD documentation in the first place.
> 

I disagree. It was certainly not obvious to me. There was example code on how to use it, and it filled a need that the axfr() method does not. 

> Are you arguing for a per-RR call-back as an optional argument to axfr()?
> 

Just mentioning that the current way is not the only possible way. What I wish right now is that the same dedication to backwards compatibility that is shown towards supporting ancient versions of Perl would be shown towards the API of Net::DNS itself.

> That way, you get your iteration done for free, we get the mechanics we need for TSIG.
> 
>    $resolver->axfr(  'example.com', 'IN', sub { my $rr = shift;  ...  }  );
> 

I put the class argument last, so I only have to spell it out in the very rare cases where it’s not IN. Other than that minor detail, that’s it exactly.

> Q:  Does the call-back function return anything?  If so what do we do with it?


Since one of the things we want to be able to do is to terminate a transfer before it’s complete (which can also not be done with the axfr() in Net::DNS::Resolver), I made that contingent on the return value from the callback. As long as it returns a true value, the process will continue (until it finishes naturally). If it returns false, the transfer will be stopped.

-- 
Calle Dybedahl
calle at init.se -*- +46 703 - 970 612



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nlnetlabs.nl/pipermail/net-dns-users/attachments/20140603/f7455891/attachment.htm>


More information about the net-dns-users mailing list