From e10ff189aca57bba91933088195d4edda199cb20 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 13 Apr 2024 23:14:48 +0200 Subject: Adding upstream version 1.9.3. Signed-off-by: Daniel Baumann --- dnsdist-async.hh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'dnsdist-async.hh') diff --git a/dnsdist-async.hh b/dnsdist-async.hh index 5a8c090..c0b8453 100644 --- a/dnsdist-async.hh +++ b/dnsdist-async.hh @@ -27,6 +27,7 @@ #include #include +#include "channel.hh" #include "dnsdist-tcp.hh" namespace dnsdist @@ -75,21 +76,28 @@ private: struct Data { + Data(bool failOpen); + Data(const Data&) = delete; + Data(Data&&) = delete; + Data& operator=(const Data&) = delete; + Data& operator=(Data&&) = delete; + ~Data() = default; + LockGuarded d_content; - FDWrapper d_notifyPipe; - FDWrapper d_watchPipe; + pdns::channel::Notifier d_notifier; + pdns::channel::Waiter d_waiter; bool d_failOpen{true}; bool d_done{false}; }; std::shared_ptr d_data{nullptr}; static void mainThread(std::shared_ptr data); - static bool wait(const Data& data, FDMultiplexer& mplexer, std::vector& readyFDs, int atMostMs); + static bool wait(Data& data, FDMultiplexer& mplexer, std::vector& readyFDs, int atMostMs); bool notify() const; }; -bool suspendQuery(DNSQuestion& dq, uint16_t asyncID, uint16_t queryID, uint32_t timeoutMs); -bool suspendResponse(DNSResponse& dr, uint16_t asyncID, uint16_t queryID, uint32_t timeoutMs); +bool suspendQuery(DNSQuestion& dnsQuestion, uint16_t asyncID, uint16_t queryID, uint32_t timeoutMs); +bool suspendResponse(DNSResponse& dnsResponse, uint16_t asyncID, uint16_t queryID, uint32_t timeoutMs); bool queueQueryResumptionEvent(std::unique_ptr&& query); bool resumeQuery(std::unique_ptr&& query); void handleQueuedAsynchronousEvents(); -- cgit v1.2.3