]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Fix a bug in the TCP connection metrics
authorRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 14 Dec 2023 15:07:30 +0000 (16:07 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 14 Dec 2023 15:07:30 +0000 (16:07 +0100)
Reported by Coverity as CID 410911: Logically dead code.

pdns/dnsdist-tcp.cc

index 0bbc9106bae958ff60ee4a597eb9f2587b51c43c..c15a14484db56b1e5afcd022dc24af4cf531a27b 100644 (file)
@@ -984,7 +984,7 @@ void IncomingTCPConnectionState::handleExceptionDuringIO(const std::exception& e
   if (d_state == State::idle || d_state == State::waitingForQuery) {
     /* no need to increase any counters in that case, the client is simply done with us */
   }
-  else if (d_state == State::doingHandshake || d_state != State::readingProxyProtocolHeader || d_state == State::waitingForQuery || d_state == State::readingQuerySize || d_state == State::readingQuery) {
+  else if (d_state == State::doingHandshake || d_state == State::readingProxyProtocolHeader || d_state == State::waitingForQuery || d_state == State::readingQuerySize || d_state == State::readingQuery) {
     ++d_ci.cs->tcpDiedReadingQuery;
   }
   else if (d_state == State::sendingResponse) {