]> granicus.if.org Git - pdns/commitdiff
dnsdist: update self-answered only for actually sent UDP responses
authorChris Hofstaedtler <chris.hofstaedtler@deduktiva.com>
Tue, 20 Feb 2018 17:53:44 +0000 (18:53 +0100)
committerChris Hofstaedtler <chris.hofstaedtler@deduktiva.com>
Tue, 20 Feb 2018 17:53:44 +0000 (18:53 +0100)
Similar to TCP handler, similar to cacheHits case.

pdns/dnsdist.cc

index 2fd7e3095726cc703358c033189ac776b1b9c1fe..fc4bbf3fe0aa83bd6889e0cafcacf9188d97c298 100644 (file)
@@ -1259,7 +1259,6 @@ static void processUDPQuery(ClientState& cs, LocalHolders& holders, const struct
     }
 
     if(dq.dh->qr) { // something turned it into a response
-      g_stats.selfAnswered++;
       restoreFlags(dh, origFlags);
 
       if (!cs.muted) {
@@ -1291,6 +1290,8 @@ static void processUDPQuery(ClientState& cs, LocalHolders& holders, const struct
         {
           sendUDPResponse(cs.udpFD, response, responseLen, delayMsec, dest, remote);
         }
+
+        g_stats.selfAnswered++;
       }
 
       return;