bool SyncRes::doOOBResolve(const DNSName& qname, const QType qtype, vector<DNSRecord>& ret, unsigned int depth, int& res)
{
- string prefix;
- if (doLog()) {
- prefix = d_prefix;
- prefix.append(depth, ' ');
- }
+ auto prefix = getPrefix(depth);
DNSName authdomain(qname);
domainmap_t::const_iterator iter = getBestAuthZone(&authdomain);
int SyncRes::doResolve(const DNSName& qname, const QType qtype, vector<DNSRecord>& ret, unsigned int depth, set<GetBestNSAnswer>& beenthere, Context& context)
{
- string prefix = d_prefix;
- prefix.append(depth, ' ');
+ auto prefix = getPrefix(depth);
auto luaconfsLocal = g_luaconfs.getLocal();
/* Apply qname (including CNAME chain) filtering policies */
*/
int SyncRes::doResolveNoQNameMinimization(const DNSName& qname, const QType qtype, vector<DNSRecord>& ret, unsigned int depth, set<GetBestNSAnswer>& beenthere, Context& context, bool* fromCache, StopAtDelegation* stopAtDelegation)
{
- string prefix;
- if (doLog()) {
- prefix = d_prefix;
- prefix.append(depth, ' ');
- }
+ auto prefix = getPrefix(depth);
LOG(prefix << qname << ": Wants " << (d_doDNSSEC ? "" : "NO ") << "DNSSEC processing, " << (d_requireAuthData ? "" : "NO ") << "auth data in query for " << qtype << endl);
}
if (doLog()) {
- string prefix = d_prefix;
- prefix.append(depth, ' ');
+ auto prefix = getPrefix(depth);
LOG(prefix << "Nameserver " << qname << " IPs: ");
bool first = true;
for (const auto& addr : ret) {
void SyncRes::getBestNSFromCache(const DNSName& qname, const QType qtype, vector<DNSRecord>& bestns, bool* flawedNSSet, unsigned int depth, set<GetBestNSAnswer>& beenthere, const boost::optional<DNSName>& cutOffDomain)
{
- string prefix;
+ auto prefix = getPrefix(depth);
DNSName subdomain(qname);
- if (doLog()) {
- prefix = d_prefix;
- prefix.append(depth, ' ');
- }
bestns.clear();
bool brokeloop;
MemRecursorCache::Flags flags = MemRecursorCache::None;
/** doesn't actually do the work, leaves that to getBestNSFromCache */
DNSName SyncRes::getBestNSNamesFromCache(const DNSName& qname, const QType qtype, NsSet& nsset, bool* flawedNSSet, unsigned int depth, set<GetBestNSAnswer>& beenthere)
{
- string prefix;
- if (doLog()) {
- prefix = d_prefix;
- prefix.append(depth, ' ');
- }
+ auto prefix = getPrefix(depth);
DNSName authOrForwDomain(qname);
domainmap_t::const_iterator iter = getBestAuthZone(&authOrForwDomain);
bool SyncRes::doCNAMECacheCheck(const DNSName& qname, const QType qtype, vector<DNSRecord>& ret, unsigned int depth, int& res, Context& context, bool wasAuthZone, bool wasForwardRecurse)
{
- string prefix;
- if (doLog()) {
- prefix = d_prefix;
- prefix.append(depth, ' ');
- }
+ auto prefix = getPrefix(depth);
if ((depth > 9 && d_outqueries > 10 && d_throttledqueries > 5) || depth > 15) {
LOG(prefix << qname << ": recursing (CNAME or other indirection) too deep, depth=" << depth << endl);
{
bool giveNegative = false;
- string prefix;
- if (doLog()) {
- prefix = d_prefix;
- prefix.append(depth, ' ');
- }
+ auto prefix = getPrefix(depth);
// sqname and sqtype are used contain 'higher' names if we have them (e.g. powerdns.com|SOA when we find a negative entry for doesnotexist.powerdns.com|A)
DNSName sqname(qname);
bool wasForwardRecurse = wasForwarded && rdQuery;
tcache_t tcache;
- string prefix;
- if (doLog()) {
- prefix = d_prefix;
- prefix.append(depth, ' ');
- }
+ auto prefix = getPrefix(depth);
fixupAnswer(prefix, lwr, qname, qtype, auth, wasForwarded, rdQuery);
sanitizeRecords(prefix, lwr, qname, qtype, auth, wasForwarded, rdQuery);
bool SyncRes::processAnswer(unsigned int depth, LWResult& lwr, const DNSName& qname, const QType qtype, DNSName& auth, bool wasForwarded, const boost::optional<Netmask> ednsmask, bool sendRDQuery, NsSet& nameservers, std::vector<DNSRecord>& ret, const DNSFilterEngine& dfe, bool* gotNewServers, int* rcode, vState& state, const ComboAddress& remoteIP)
{
- string prefix;
- if (doLog()) {
- prefix = d_prefix;
- prefix.append(depth, ' ');
- }
+ auto prefix = getPrefix(depth);
if (s_minimumTTL) {
for (auto& rec : lwr.d_records) {
map<DNSName, vector<ComboAddress>>* fallBack)
{
auto luaconfsLocal = g_luaconfs.getLocal();
- string prefix;
- if (doLog()) {
- prefix = d_prefix;
- prefix.append(depth, ' ');
- }
+ auto prefix = getPrefix(depth);
LOG(prefix << qname << ": Cache consultations done, have " << (unsigned int)nameservers.size() << " NS to contact");