]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Fix "in-flight" queries counter for XFR, plus a few typos
authorRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 16 Nov 2020 10:49:19 +0000 (11:49 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 16 Nov 2020 10:49:19 +0000 (11:49 +0100)
pdns/dnsdist-tcp.cc
pdns/dnsdistdist/dnsdist-tcp-downstream.hh

index db1747410154857f18f96deaac2429a3360e06b0..a8d9963d236d93e7c60c5a066526454b4d6868b5 100644 (file)
@@ -290,9 +290,9 @@ static IOState sendQueuedResponses(std::shared_ptr<IncomingTCPConnectionState>&
 
 static bool handleResponseSent(std::shared_ptr<IncomingTCPConnectionState>& state, const struct timeval& now)
 {
-  --state->d_currentQueriesCount;
-
   if (!state->d_isXFR) {
+    --state->d_currentQueriesCount;
+
     const auto& currentResponse = state->d_currentResponse;
     if (state->d_selfGeneratedResponse == false && currentResponse.d_connection && currentResponse.d_connection->getDS()) {
       const auto& ds = currentResponse.d_connection->getDS();
@@ -410,7 +410,7 @@ IOState IncomingTCPConnectionState::sendResponse(std::shared_ptr<IncomingTCPConn
 /* called when handling a response or error coming from a backend */
 void IncomingTCPConnectionState::sendOrQueueResponse(std::shared_ptr<IncomingTCPConnectionState>& state, const struct timeval& now, TCPResponse&& response)
 {
-  // if we already reading a query (not the query size, mind you), or sending a response we need to either queue the response
+  // if we were already reading a query (not the query size, mind you), or sending a response we need to queue the response
   // otherwise we can start sending it right away
   if (state->d_state == IncomingTCPConnectionState::State::idle ||
       state->d_state == IncomingTCPConnectionState::State::readingQuerySize) {
index fdfcfbbd86e9bcae0a86d63fa371a478243ad6a2..fa4c950ae161e513fac40efbae3ae938c52542f7 100644 (file)
@@ -110,7 +110,7 @@ public:
     return d_enableFastOpen;
   }
 
-  /* whether we can acept new queries FOR THE SAME CLIENT */
+  /* whether we can accept new queries FOR THE SAME CLIENT */
   bool canAcceptNewQueries() const
   {
     if (d_usedForXFR || d_connectionDied) {