]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Fix the health-check timeout computation for DoH backend 12327/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 14 Dec 2022 15:10:49 +0000 (16:10 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 14 Dec 2022 15:10:49 +0000 (16:10 +0100)
The remaining milliseconds after handling the full seconds was not
properly converted to microseconds.

pdns/dnsdistdist/dnsdist-tcp-downstream.hh

index 939e6a041ae15d95b20f542cadb8127e53ef5b7a..c966f823c7966fd6f701d8aa222acb439310960a 100644 (file)
@@ -156,7 +156,7 @@ protected:
 
     struct timeval res = now;
     res.tv_sec += d_ds->d_config.checkTimeout / 1000; /* ms to s */
-    res.tv_usec += (d_ds->d_config.checkTimeout % 1000) / 1000; /* remaining ms to µs */
+    res.tv_usec += (d_ds->d_config.checkTimeout % 1000) * 1000; /* remaining ms to µs */
 
     return res;
   }