From 07b66264266ed5e82fd38ab5e61a84010c103b7d Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Tue, 16 Jul 2019 09:59:14 +0200 Subject: [PATCH] dnsdist: Fix timeout handling when reusing an IDS from DoH --- pdns/dnsdistdist/doh.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pdns/dnsdistdist/doh.cc b/pdns/dnsdistdist/doh.cc index c3c93511fa..021578a150 100644 --- a/pdns/dnsdistdist/doh.cc +++ b/pdns/dnsdistdist/doh.cc @@ -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; -- 2.47.2