From 68f77a91b7d4e712bc068c02e64097651a6f30a6 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Mon, 31 Jan 2022 10:53:10 +0100 Subject: [PATCH] dnsdist: Fix the health-check timeout for outgoing DoH connections The health-check timeout is in milliseconds, contrary to the other ones that are in seconds. --- pdns/dnsdistdist/dnsdist-tcp-downstream.hh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pdns/dnsdistdist/dnsdist-tcp-downstream.hh b/pdns/dnsdistdist/dnsdist-tcp-downstream.hh index f85fc36e5e..547d266b8a 100644 --- a/pdns/dnsdistdist/dnsdist-tcp-downstream.hh +++ b/pdns/dnsdistdist/dnsdist-tcp-downstream.hh @@ -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; } -- 2.47.2