]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Correctly account actively discovered timeouts in StatNode
authorRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 12 Nov 2019 08:33:26 +0000 (09:33 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 12 Nov 2019 08:33:26 +0000 (09:33 +0100)
pdns/dnsdist-dynblocks.hh
pdns/dnsdist-lua-inspection.cc

index 5d9923fb07efafbd5b188d6fd767b53ce6b4a8ce..dd834a1655bbb41776fb9b4e061cff6c3112e430 100644 (file)
@@ -576,7 +576,7 @@ private:
         }
 
         if (suffixMatchRuleMatches) {
-          root.submit(c.name, c.dh.rcode, boost::none);
+          root.submit(c.name, ((c.dh.rcode == 0 && c.usec == std::numeric_limits<unsigned int>::max()) ? -1 : c.dh.rcode), boost::none);
         }
       }
     }
index 1c335f283cbe40410c224ebf78a87d2c2f012a60..bbd3da7a3cef2c43008075b6ecb5e8791f70854f 100644 (file)
@@ -117,7 +117,7 @@ static void statNodeRespRing(statvisitor_t visitor, unsigned int seconds)
       if (seconds && c.when < cutoff)
         continue;
 
-      root.submit(c.name, c.dh.rcode, boost::none);
+      root.submit(c.name, ((c.dh.rcode == 0 && c.usec == std::numeric_limits<unsigned int>::max()) ? -1 : c.dh.rcode), boost::none);
     }
   }