From: Remi Gacogne Date: Tue, 21 Jun 2022 15:27:05 +0000 (+0200) Subject: dnsdist: Do not pretend that a connection will be reusable when it's dead X-Git-Tag: auth-4.8.0-alpha0~39^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=500b4e9cfb7ed2e2b09ee49300482f6b4d218551;p=thirdparty%2Fpdns.git dnsdist: Do not pretend that a connection will be reusable when it's dead By remember that a connection is no longer usable when we notice that, we prevent a case where we could pretend that it will be usable when it has finished processing the current queries and responses, which is not true. --- diff --git a/pdns/dnsdistdist/dnsdist-tcp-downstream.hh b/pdns/dnsdistdist/dnsdist-tcp-downstream.hh index c257e0c124..939e6a041a 100644 --- a/pdns/dnsdistdist/dnsdist-tcp-downstream.hh +++ b/pdns/dnsdistdist/dnsdist-tcp-downstream.hh @@ -25,13 +25,19 @@ public: } /* whether the underlying socket has been closed under our feet, basically */ - bool isUsable() const + bool isUsable() { if (!d_handler) { + d_connectionDied = true; return false; } - return d_handler->isUsable(); + if (d_handler->isUsable()) { + return true; + } + + d_connectionDied = true; + return false; } const std::shared_ptr& getDS() const