AtomicCounter PacketHandler::s_count;
extern string s_programname;
+enum root_referral {
+ NO_ROOT_REFERRAL,
+ LEAN_ROOT_REFERRAL,
+ FULL_ROOT_REFERRAL
+};
+
PacketHandler::PacketHandler():B(s_programname)
{
++s_count;
d_doRecursion= ::arg().mustDo("recursor");
d_logDNSDetails= ::arg().mustDo("log-dns-details");
d_doIPv6AdditionalProcessing = ::arg().mustDo("do-ipv6-additional-processing");
+ d_sendRootReferral = ::arg().mustDo("send-root-referral")
+ ? ( pdns_iequals(::arg()["send-root-referral"], "lean") ? LEAN_ROOT_REFERRAL : FULL_ROOT_REFERRAL )
+ : NO_ROOT_REFERRAL;
string fname= ::arg()["lua-prequery-script"];
if(fname.empty())
{
r->addRecord(rr);
}
- if(pdns_iequals(::arg()["send-root-referral"], "lean"))
+ if( d_sendRootReferral == LEAN_ROOT_REFERRAL )
return;
// add the additional stuff
if(!retargetcount)
r->setA(false); // drop AA if we never had a SOA in the first place
- if(::arg().mustDo("send-root-referral")) {
+ if( d_sendRootReferral != NO_ROOT_REFERRAL ) {
DLOG(L<<Logger::Warning<<"Adding root-referral"<<endl);
addRootReferral(r);
}