]> granicus.if.org Git - pdns/commitdiff
dnsdist: Update frontend* stats over TCP as well
authorRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 23 Sep 2019 14:34:38 +0000 (16:34 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 23 Sep 2019 14:34:38 +0000 (16:34 +0200)
pdns/dnsdist-tcp.cc

index edd006b2a5444f7b17b2d28ce6f4ca188192917b..67f71f33bc3f5ea42a7dc9e2d66e4f124d873f13 100644 (file)
@@ -673,6 +673,19 @@ static void handleResponseSent(std::shared_ptr<IncomingTCPConnectionState>& stat
     vinfolog("Got answer from %s, relayed to %s (%s), took %f usec", state->d_ds->remote.toStringWithPort(), state->d_ids.origRemote.toStringWithPort(), (state->d_ci.cs->tlsFrontend ? "DoT" : "TCP"), udiff);
   }
 
+  switch (state->d_cleartextDH.rcode) {
+  case RCode::NXDomain:
+    ++g_stats.frontendNXDomain;
+    break;
+  case RCode::ServFail:
+    ++g_stats.servfailResponses;
+    ++g_stats.frontendServFail;
+    break;
+  case RCode::NoError:
+    ++g_stats.frontendNoError;
+    break;
+  }
+
   if (g_maxTCPQueriesPerConn && state->d_queriesCount > g_maxTCPQueriesPerConn) {
     vinfolog("Terminating TCP connection from %s because it reached the maximum number of queries per conn (%d / %d)", state->d_ci.remote.toStringWithPort(), state->d_queriesCount, g_maxTCPQueriesPerConn);
     return;