]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Fix latency and counters update for UDP cache hits 11798/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 19 Jul 2022 13:25:48 +0000 (15:25 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 19 Jul 2022 13:28:43 +0000 (15:28 +0200)
The latency was counted twice, and the frontend-nxdomain,
frontend-noerror and frontend-servfail was increased twice as well.

pdns/dnsdist.cc

index 55943875d9d4feaaae83bcdedd651931c3915bff..75d23d0416864e48c2c77f5262c56d557f396075 100644 (file)
@@ -1242,19 +1242,6 @@ static bool prepareOutgoingResponse(LocalHolders& holders, ClientState& cs, DNSQ
     ++g_stats.cacheHits;
   }
 
-  switch (dr.getHeader()->rcode) {
-  case RCode::NXDomain:
-    ++g_stats.frontendNXDomain;
-    break;
-  case RCode::ServFail:
-    ++g_stats.frontendServFail;
-    break;
-  case RCode::NoError:
-    ++g_stats.frontendNoError;
-    break;
-  }
-
-  doLatencyStats(cs.getProtocol(), 0);  // we're not going to measure this
   return true;
 }