]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Fix the health-check timeout for outgoing DoH connections 11253/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 31 Jan 2022 09:53:10 +0000 (10:53 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 31 Jan 2022 09:53:10 +0000 (10:53 +0100)
The health-check timeout is in milliseconds, contrary to the other
ones that are in seconds.

pdns/dnsdistdist/dnsdist-tcp-downstream.hh

index f85fc36e5e724f1056e6ec273252ab9e8ebaa304..547d266b8ab85137f8a51f2f5178d1f2eaec1994 100644 (file)
@@ -151,7 +151,8 @@ protected:
     }
 
     struct timeval res = now;
-    res.tv_sec += d_ds->checkTimeout;
+    res.tv_sec += d_ds->checkTimeout / 1000; /* ms to s */
+    res.tv_usec += (d_ds->checkTimeout % 1000) / 1000; /* remaining ms to µs */
 
     return res;
   }