]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Fix invalid outstanding count for {A,I}XFR over TCP 4348/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 23 Aug 2016 08:47:23 +0000 (10:47 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 23 Aug 2016 08:47:23 +0000 (10:47 +0200)
pdns/dnsdist-tcp.cc

index c76cb1e196fdf0497a1a2e2d7774edfe10241408..9b71b356e1891ae7845a98ca2c1c565c9da88daf 100644 (file)
@@ -415,8 +415,11 @@ void* tcpClientThread(int pipefd)
         readn2WithTimeout(dsock, answerbuffer, rlen, ds->tcpRecvTimeout);
         char* response = answerbuffer;
         uint16_t responseLen = rlen;
-        --ds->outstanding;
-        outstanding = false;
+        if (outstanding) {
+          /* might be false for {A,I}XFR */
+          --ds->outstanding;
+          outstanding = false;
+        }
 
         if (rlen < sizeof(dnsheader)) {
           break;