]> granicus.if.org Git - pdns/commitdiff
dnsdist: Fix timeout handling when reusing an IDS from DoH
authorRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 16 Jul 2019 07:59:14 +0000 (09:59 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 16 Jul 2019 07:59:14 +0000 (09:59 +0200)
pdns/dnsdistdist/doh.cc

index c3c93511fa93c0b8b22892db14cfdbce4a273b1c..021578a150c906c5d174a350b84f8ff477a5650b 100644 (file)
@@ -246,16 +246,17 @@ static int processDOHQuery(DOHUnit* du)
     if (oldFD < 0) {
       // if we are reusing, no change in outstanding
       ++ss->outstanding;
+      /* either it was already -1 so no DOH unit to handle,
+         or someone handled it before us */
+      oldDU = nullptr;
     }
     else {
       ++ss->reuseds;
       ++g_stats.downstreamTimeouts;
-      /* origFD is not -1 anymore, we can't touch it */
-      oldDU = nullptr;
+      ids->du = nullptr;
+      handleDOHTimeout(oldDU);
     }
 
-    handleDOHTimeout(oldDU);
-
     ids->du = du;
 
     ids->cs = &cs;