]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Fix the accounting of 'active' connections
authorRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 9 Sep 2020 15:21:28 +0000 (17:21 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 10 Nov 2020 08:46:54 +0000 (09:46 +0100)
pdns/dnsdistdist/dnsdist-tcp-downstream.cc

index 03a4c41b244acb4812ad7b686782a1f85ee838b9..0a5a11b1df7a1c2c53110f6c7bffeb47ed008814 100644 (file)
@@ -440,9 +440,9 @@ IOState TCPConnectionToBackend::handleResponse(std::shared_ptr<TCPConnectionToBa
       return IOState::Done;
     }
     auto ids = std::move(it->second.d_idstate);
+    d_pendingResponses.erase(it);
     DEBUGLOG("passing response to client connection for "<<ids.qname);
     clientConn->handleResponse(clientConn, now, TCPResponse(std::move(d_responseBuffer), std::move(ids), conn));
-    d_pendingResponses.erase(it);
 
     if (!d_pendingQueries.empty()) {
       DEBUGLOG("still have some queries to send");