From: Peter van Dijk Date: Tue, 22 Jan 2013 14:21:06 +0000 (+0000) Subject: replace previous broken commit with actual fix for trace=fail and trace-regex X-Git-Tag: rec-3.5-rc1~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0fe1d0806cb3f962800d39319c36f50c4e533e76;p=thirdparty%2Fpdns.git replace previous broken commit with actual fix for trace=fail and trace-regex git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@3073 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index dbc29aa685..6b79582f46 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -550,15 +550,8 @@ void startDoResolve(void *p) uint32_t minTTL=std::numeric_limits::max(); - if(res < 0) { - pw.getHeader()->rcode=RCode::ServFail; - // no commit here, because no record - g_stats.servFails++; - } - - if(tracedQuery || pw.getHeader()->rcode == RCode::ServFail) + if(tracedQuery || res < 0 || res == RCode::ServFail || pw.getHeader()->rcode == RCode::ServFail) { - // log trace, if we have one string trace(sr.getTrace()); if(!trace.empty()) { vector lines; @@ -569,6 +562,12 @@ void startDoResolve(void *p) } } } + + if(res < 0) { + pw.getHeader()->rcode=RCode::ServFail; + // no commit here, because no record + g_stats.servFails++; + } else { pw.getHeader()->rcode=res; updateRcodeStats(res);