From: Remi Gacogne Date: Tue, 17 Oct 2023 08:58:27 +0000 (+0200) Subject: dnsdist: Fix the case where nghttp2 is available but DoH is disabled X-Git-Tag: rec-5.0.0-beta1~27^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cf25b82bbf2b55ce41ccf502dbd117f8df2f1602;p=thirdparty%2Fpdns.git dnsdist: Fix the case where nghttp2 is available but DoH is disabled --- diff --git a/pdns/dnsdist-lua-inspection.cc b/pdns/dnsdist-lua-inspection.cc index f778a492dd..4b317808c4 100644 --- a/pdns/dnsdist-lua-inspection.cc +++ b/pdns/dnsdist-lua-inspection.cc @@ -728,7 +728,9 @@ void setupLuaInspection(LuaContext& luaCtx) luaCtx.writeFunction("requestDoHStatesDump", [] { setLuaNoSideEffect(); +#if defined(HAVE_DNS_OVER_HTTPS) && defined(HAVE_NGHTTP2) g_dohStatesDumpRequested += g_dohClientThreads->getThreadsCount(); +#endif }); luaCtx.writeFunction("dumpStats", [] { diff --git a/pdns/dnsdist-lua.cc b/pdns/dnsdist-lua.cc index e39748e8c2..e324d759a6 100644 --- a/pdns/dnsdist-lua.cc +++ b/pdns/dnsdist-lua.cc @@ -544,7 +544,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck) tlsCtx = getTLSContext(config.d_tlsParams); if (getOptionalValue(vars, "dohPath", valueStr) > 0) { -#ifndef HAVE_NGHTTP2 +#if !defined(HAVE_DNS_OVER_HTTPS) || !defined(HAVE_NGHTTP2) throw std::runtime_error("Outgoing DNS over HTTPS support requested (via 'dohPath' on newServer()) but nghttp2 support is not available"); #endif @@ -1332,6 +1332,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck) setTCPDownstreamMaxIdleConnectionsPerBackend(max); }); +#if defined(HAVE_DNS_OVER_HTTPS) && defined(HAVE_NGHTTP2) luaCtx.writeFunction("setMaxIdleDoHConnectionsPerDownstream", [](uint64_t max) { setDoHDownstreamMaxIdleConnectionsPerBackend(max); }); @@ -1342,6 +1343,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck) } g_outgoingDoHWorkerThreads = workers; }); +#endif /* HAVE_DNS_OVER_HTTPS && HAVE_NGHTTP2 */ luaCtx.writeFunction("setOutgoingTLSSessionsCacheMaxTicketsPerBackend", [](uint64_t max) { if (!checkConfigurationTime("setOutgoingTLSSessionsCacheMaxTicketsPerBackend")) { @@ -2120,11 +2122,13 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck) setTCPDownstreamCleanupInterval(interval); }); +#if defined(HAVE_DNS_OVER_HTTPS) && defined(HAVE_NGHTTP2) luaCtx.writeFunction("setDoHDownstreamCleanupInterval", [](uint64_t interval) { setLuaSideEffect(); checkParameterBound("setDoHDownstreamCleanupInterval", interval); setDoHDownstreamCleanupInterval(interval); }); +#endif /* HAVE_DNS_OVER_HTTPS && HAVE_NGHTTP2 */ luaCtx.writeFunction("setTCPDownstreamMaxIdleTime", [](uint64_t max) { setLuaSideEffect(); @@ -2132,11 +2136,13 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck) setTCPDownstreamMaxIdleTime(max); }); +#if defined(HAVE_DNS_OVER_HTTPS) && defined(HAVE_NGHTTP2) luaCtx.writeFunction("setDoHDownstreamMaxIdleTime", [](uint64_t max) { setLuaSideEffect(); checkParameterBound("setDoHDownstreamMaxIdleTime", max); setDoHDownstreamMaxIdleTime(max); }); +#endif /* HAVE_DNS_OVER_HTTPS && HAVE_NGHTTP2 */ luaCtx.writeFunction("setConsoleConnectionsLogging", [](bool enabled) { g_logConsoleConnections = enabled; diff --git a/pdns/dnsdist-tcp.cc b/pdns/dnsdist-tcp.cc index 7b94e00e51..5a4bead7d0 100644 --- a/pdns/dnsdist-tcp.cc +++ b/pdns/dnsdist-tcp.cc @@ -1242,10 +1242,10 @@ static void handleIncomingTCPQuery(int pipefd, FDMultiplexer::funcparam_t& param gettimeofday(&now, nullptr); if (citmp->cs->dohFrontend) { -#ifdef HAVE_NGHTTP2 +#if defined(HAVE_DNS_OVER_HTTPS) && defined(HAVE_NGHTTP2) auto state = std::make_shared(std::move(*citmp), *threadData, now); state->handleIO(); -#endif /* HAVE_NGHTTP2 */ +#endif /* HAVE_DNS_OVER_HTTPS && HAVE_NGHTTP2 */ } else { auto state = std::make_shared(std::move(*citmp), *threadData, now); @@ -1396,7 +1396,7 @@ static void tcpClientThread(pdns::channel::Receiver&& queryRecei state->handleTimeout(state, false); } } -#ifdef HAVE_NGHTTP2 +#if defined(HAVE_DNS_OVER_HTTPS) && defined(HAVE_NGHTTP2) else if (cbData.second.type() == typeid(std::shared_ptr)) { auto state = boost::any_cast>(cbData.second); if (cbData.first == state->d_handler.getDescriptor()) { @@ -1405,7 +1405,7 @@ static void tcpClientThread(pdns::channel::Receiver&& queryRecei state->handleTimeout(parentState, false); } } -#endif /* HAVE_NGHTTP2 */ +#endif /* HAVE_DNS_OVER_HTTPS && HAVE_NGHTTP2 */ else if (cbData.second.type() == typeid(std::shared_ptr)) { auto conn = boost::any_cast>(cbData.second); vinfolog("Timeout (read) from remote backend %s", conn->getBackendName()); @@ -1422,7 +1422,7 @@ static void tcpClientThread(pdns::channel::Receiver&& queryRecei state->handleTimeout(state, true); } } -#ifdef HAVE_NGHTTP2 +#if defined(HAVE_DNS_OVER_HTTPS) && defined(HAVE_NGHTTP2) else if (cbData.second.type() == typeid(std::shared_ptr)) { auto state = boost::any_cast>(cbData.second); if (cbData.first == state->d_handler.getDescriptor()) { @@ -1431,7 +1431,7 @@ static void tcpClientThread(pdns::channel::Receiver&& queryRecei state->handleTimeout(parentState, true); } } -#endif /* HAVE_NGHTTP2 */ +#endif /* HAVE_DNS_OVER_HTTPS && HAVE_NGHTTP2 */ else if (cbData.second.type() == typeid(std::shared_ptr)) { auto conn = boost::any_cast>(cbData.second); vinfolog("Timeout (write) from remote backend %s", conn->getBackendName()); @@ -1462,12 +1462,12 @@ static void tcpClientThread(pdns::channel::Receiver&& queryRecei auto state = boost::any_cast>(param); infolog(" - %s", state->toString()); } -#ifdef HAVE_NGHTTP2 +#if defined(HAVE_DNS_OVER_HTTPS) && defined(HAVE_NGHTTP2) else if (param.type() == typeid(std::shared_ptr)) { auto state = boost::any_cast>(param); infolog(" - %s", state->toString()); } -#endif /* HAVE_NGHTTP2 */ +#endif /* HAVE_DNS_OVER_HTTPS && HAVE_NGHTTP2 */ else if (param.type() == typeid(std::shared_ptr)) { auto conn = boost::any_cast>(param); infolog(" - %s", conn->toString()); @@ -1567,10 +1567,10 @@ static void acceptNewConnection(const TCPAcceptorParam& param, TCPClientThreadDa gettimeofday(&now, nullptr); if (ci.cs->dohFrontend) { -#ifdef HAVE_NGHTTP2 +#if defined(HAVE_DNS_OVER_HTTPS) && defined(HAVE_NGHTTP2) auto state = std::make_shared(std::move(ci), *threadData, now); state->handleIO(); -#endif /* HAVE_NGHTTP2 */ +#endif /* HAVE_DNS_OVER_HTTPS && HAVE_NGHTTP2 */ } else { auto state = std::make_shared(std::move(ci), *threadData, now); diff --git a/pdns/dnsdist.cc b/pdns/dnsdist.cc index 71955161dc..6798ef06ce 100644 --- a/pdns/dnsdist.cc +++ b/pdns/dnsdist.cc @@ -2916,7 +2916,9 @@ int main(int argc, char** argv) g_tcpclientthreads = std::make_unique(*g_maxTCPClientThreads, std::vector()); #endif +#if defined(HAVE_DNS_OVER_HTTPS) && defined(HAVE_NGHTTP2) initDoHWorkers(); +#endif for (auto& todoItem : todo) { todoItem(); diff --git a/pdns/dnsdistdist/Makefile.am b/pdns/dnsdistdist/Makefile.am index f9a7bc297b..c7e5ebd117 100644 --- a/pdns/dnsdistdist/Makefile.am +++ b/pdns/dnsdistdist/Makefile.am @@ -185,8 +185,8 @@ dnsdist_SOURCES = \ dnsdist-lua.cc dnsdist-lua.hh \ dnsdist-mac-address.cc dnsdist-mac-address.hh \ dnsdist-metrics.cc dnsdist-metrics.hh \ - dnsdist-nghttp2-in.cc dnsdist-nghttp2-in.hh \ - dnsdist-nghttp2.cc dnsdist-nghttp2.hh \ + dnsdist-nghttp2-in.hh \ + dnsdist-nghttp2.hh \ dnsdist-prometheus.hh \ dnsdist-protobuf.cc dnsdist-protobuf.hh \ dnsdist-protocols.cc dnsdist-protocols.hh \ @@ -284,8 +284,8 @@ testrunner_SOURCES = \ dnsdist-lua-vars.cc \ dnsdist-mac-address.cc dnsdist-mac-address.hh \ dnsdist-metrics.cc dnsdist-metrics.hh \ - dnsdist-nghttp2-in.cc dnsdist-nghttp2-in.hh \ - dnsdist-nghttp2.cc dnsdist-nghttp2.hh \ + dnsdist-nghttp2-in.hh \ + dnsdist-nghttp2.hh \ dnsdist-protocols.cc dnsdist-protocols.hh \ dnsdist-proxy-protocol.cc dnsdist-proxy-protocol.hh \ dnsdist-random.cc dnsdist-random.hh \ @@ -339,8 +339,6 @@ testrunner_SOURCES = \ test-dnsdistkvs_cc.cc \ test-dnsdistlbpolicies_cc.cc \ test-dnsdistluanetwork.cc \ - test-dnsdistnghttp2-in_cc.cc \ - test-dnsdistnghttp2_cc.cc \ test-dnsdistnghttp2_common.hh \ test-dnsdistpacketcache_cc.cc \ test-dnsdistrings_cc.cc \ @@ -435,6 +433,17 @@ dnsdist_SOURCES += doh.cc dnsdist_LDADD += $(LIBH2OEVLOOP_LIBS) endif +if HAVE_NGHTTP2 +dnsdist_SOURCES += dnsdist-nghttp2-in.cc +dnsdist_SOURCES += dnsdist-nghttp2.cc +testrunner_SOURCES += dnsdist-nghttp2-in.cc +testrunner_SOURCES += dnsdist-nghttp2.cc +testrunner_SOURCES += test-dnsdistnghttp2-in_cc.cc \ + test-dnsdistnghttp2_cc.cc +dnsdist_LDADD += $(NGHTTP2_LDFLAGS) $(NGHTTP2_LIBS) +testrunner_LDADD += $(NGHTTP2_LDFLAGS) $(NGHTTP2_LIBS) +endif + endif if HAVE_DNS_OVER_QUIC @@ -445,11 +454,6 @@ dnsdist_LDADD += $(QUICHE_LDFLAGS) $(QUICHE_LIBS) endif endif -if HAVE_NGHTTP2 -dnsdist_LDADD += $(NGHTTP2_LDFLAGS) $(NGHTTP2_LIBS) -testrunner_LDADD += $(NGHTTP2_LDFLAGS) $(NGHTTP2_LIBS) -endif - if !HAVE_LUA_HPP BUILT_SOURCES += lua.hpp nodist_dnsdist_SOURCES = lua.hpp diff --git a/pdns/dnsdistdist/configure.ac b/pdns/dnsdistdist/configure.ac index 11495c3c79..8de53ba368 100644 --- a/pdns/dnsdistdist/configure.ac +++ b/pdns/dnsdistdist/configure.ac @@ -113,7 +113,6 @@ AS_IF([test "x$enable_dns_over_quic" != "xno"], [ ]) ]) -PDNS_WITH_NGHTTP2 DNSDIST_WITH_CDB PDNS_CHECK_LMDB PDNS_ENABLE_IPCIPHER diff --git a/pdns/dnsdistdist/dnsdist-backend.cc b/pdns/dnsdistdist/dnsdist-backend.cc index 44b3d9c39d..d3d70abc84 100644 --- a/pdns/dnsdistdist/dnsdist-backend.cc +++ b/pdns/dnsdistdist/dnsdist-backend.cc @@ -30,12 +30,12 @@ bool DownstreamState::passCrossProtocolQuery(std::unique_ptr&& cpq) { - if (d_config.d_dohPath.empty()) { - return g_tcpclientthreads && g_tcpclientthreads->passCrossProtocolQueryToThread(std::move(cpq)); - } - else { +#if defined(HAVE_DNS_OVER_HTTPS) && defined(HAVE_NGHTTP2) + if (!d_config.d_dohPath.empty()) { return g_dohClientThreads && g_dohClientThreads->passCrossProtocolQueryToThread(std::move(cpq)); } +#endif + return g_tcpclientthreads && g_tcpclientthreads->passCrossProtocolQueryToThread(std::move(cpq)); } bool DownstreamState::reconnect(bool initialAttempt) diff --git a/pdns/dnsdistdist/dnsdist-healthchecks.cc b/pdns/dnsdistdist/dnsdist-healthchecks.cc index 37139e8661..36805573e7 100644 --- a/pdns/dnsdistdist/dnsdist-healthchecks.cc +++ b/pdns/dnsdistdist/dnsdist-healthchecks.cc @@ -390,6 +390,7 @@ bool queueHealthCheck(std::unique_ptr& mplexer, const std::shared mplexer->addReadFD(data->d_udpSocket.getHandle(), &healthCheckUDPCallback, data, &data->d_ttd); } +#if defined(HAVE_DNS_OVER_HTTPS) && defined(HAVE_NGHTTP2) else if (downstream->isDoH()) { InternalQuery query(std::move(packet), InternalQueryState()); query.d_proxyProtocolPayload = std::move(proxyProtocolPayload); @@ -398,6 +399,7 @@ bool queueHealthCheck(std::unique_ptr& mplexer, const std::shared data->d_ds->submitHealthCheckResult(data->d_initial, false); } } +#endif else { data->d_tcpHandler = std::make_unique(downstream->d_config.d_tlsSubjectName, downstream->d_config.d_tlsSubjectIsAddr, sock.releaseHandle(), timeval{downstream->d_config.checkTimeout, 0}, downstream->d_tlsCtx); data->d_ioState = std::make_unique(*mplexer, data->d_tcpHandler->getDescriptor()); @@ -464,7 +466,9 @@ void handleQueuedHealthChecks(FDMultiplexer& mplexer, bool initial) continue; } +#if defined(HAVE_DNS_OVER_HTTPS) && defined(HAVE_NGHTTP2) handleH2Timeouts(mplexer, now); +#endif auto timeouts = mplexer.getTimeouts(now); for (const auto& timeout : timeouts) { diff --git a/pdns/dnsdistdist/dnsdist-nghttp2-in.cc b/pdns/dnsdistdist/dnsdist-nghttp2-in.cc index 7c7864466f..3b01c47bc9 100644 --- a/pdns/dnsdistdist/dnsdist-nghttp2-in.cc +++ b/pdns/dnsdistdist/dnsdist-nghttp2-in.cc @@ -25,7 +25,7 @@ #include "dnsdist-proxy-protocol.hh" #include "dnsparser.hh" -#ifdef HAVE_NGHTTP2 +#if defined(HAVE_DNS_OVER_HTTPS) && defined(HAVE_NGHTTP2) #if 0 class IncomingDoHCrossProtocolContext : public CrossProtocolContext @@ -1228,4 +1228,4 @@ bool IncomingHTTP2Connection::active() const return !d_connectionDied && d_ioState != nullptr; } -#endif /* HAVE_NGHTTP2 */ +#endif /* HAVE_DNS_OVER_HTTPS && HAVE_NGHTTP2 */ diff --git a/pdns/dnsdistdist/dnsdist-nghttp2-in.hh b/pdns/dnsdistdist/dnsdist-nghttp2-in.hh index 020e1c26e3..a2e58a45a9 100644 --- a/pdns/dnsdistdist/dnsdist-nghttp2-in.hh +++ b/pdns/dnsdistdist/dnsdist-nghttp2-in.hh @@ -22,7 +22,7 @@ #pragma once #include "config.h" -#ifdef HAVE_NGHTTP2 +#if defined(HAVE_DNS_OVER_HTTPS) && defined(HAVE_NGHTTP2) #include #include "dnsdist-tcp-upstream.hh" @@ -156,4 +156,4 @@ public: static void addCustomDynamicHeader(std::vector& headers, const std::string& name, const std::string_view& value); }; -#endif /* HAVE_NGHTTP2 */ +#endif /* HAVE_DNS_OVER_HTTPS && HAVE_NGHTTP2 */ diff --git a/pdns/dnsdistdist/dnsdist-nghttp2.cc b/pdns/dnsdistdist/dnsdist-nghttp2.cc index 163d2df092..0db65fb38a 100644 --- a/pdns/dnsdistdist/dnsdist-nghttp2.cc +++ b/pdns/dnsdistdist/dnsdist-nghttp2.cc @@ -22,9 +22,9 @@ #include "config.h" -#ifdef HAVE_NGHTTP2 +#if defined(HAVE_DNS_OVER_HTTPS) && defined(HAVE_NGHTTP2) #include -#endif /* HAVE_NGHTTP2 */ +#endif /* HAVE_DNS_OVER_HTTPS && HAVE_NGHTTP2 */ #include "dnsdist-nghttp2.hh" #include "dnsdist-nghttp2-in.hh" @@ -45,7 +45,7 @@ std::atomic g_dohStatesDumpRequested{0}; std::unique_ptr g_dohClientThreads{nullptr}; std::optional g_outgoingDoHWorkerThreads{std::nullopt}; -#ifdef HAVE_NGHTTP2 +#if defined(HAVE_DNS_OVER_HTTPS) && defined(HAVE_NGHTTP2) class DoHConnectionToBackend : public ConnectionToBackend { public: @@ -932,7 +932,7 @@ static bool select_next_proto_callback(unsigned char** out, unsigned char* outle return true; } -#endif /* HAVE_NGHTTP2 */ +#endif /* HAVE_DNS_OVER_HTTPS && HAVE_NGHTTP2 */ struct DoHClientCollection::DoHWorkerThread { @@ -984,7 +984,7 @@ bool DoHClientCollection::passCrossProtocolQueryToThread(std::unique_ptr(pdns::channel::SenderBlockingMode::SenderNonBlocking, pdns::channel::ReceiverBlockingMode::ReceiverNonBlocking, g_tcpInternalPipeBufferSize); @@ -1014,14 +1014,14 @@ void DoHClientCollection::addThread() errlog("Error creating the DoH channel: %s", e.what()); return; } -#else /* HAVE_NGHTTP2 */ +#else /* HAVE_DNS_OVER_HTTPS && HAVE_NGHTTP2 */ throw std::runtime_error("DoHClientCollection::addThread() called but nghttp2 support is not available"); -#endif /* HAVE_NGHTTP2 */ +#endif /* HAVE_DNS_OVER_HTTPS && HAVE_NGHTTP2 */ } bool initDoHWorkers() { -#ifdef HAVE_NGHTTP2 +#if defined(HAVE_DNS_OVER_HTTPS) && defined(HAVE_NGHTTP2) if (!g_outgoingDoHWorkerThreads) { /* Unless the value has been set to 0 explicitly, always start at least one outgoing DoH worker thread, in case a DoH backend is added at a later time. */ @@ -1037,7 +1037,7 @@ bool initDoHWorkers() return true; #else return false; -#endif /* HAVE_NGHTTP2 */ +#endif /* HAVE_DNS_OVER_HTTPS && HAVE_NGHTTP2 */ } bool setupDoHClientProtocolNegotiation(std::shared_ptr& ctx) @@ -1045,20 +1045,20 @@ bool setupDoHClientProtocolNegotiation(std::shared_ptr& ctx) if (ctx == nullptr) { return false; } -#ifdef HAVE_NGHTTP2 +#if defined(HAVE_DNS_OVER_HTTPS) && defined(HAVE_NGHTTP2) /* we want to set the ALPN to h2, if only to mitigate the ALPACA attack */ const std::vector> h2Alpns = {{'h', '2'}}; ctx->setALPNProtos(h2Alpns); ctx->setNextProtocolSelectCallback(select_next_proto_callback); return true; -#else /* HAVE_NGHTTP2 */ +#else /* HAVE_DNS_OVER_HTTPS && HAVE_NGHTTP2 */ return false; -#endif /* HAVE_NGHTTP2 */ +#endif /* HAVE_DNS_OVER_HTTPS && HAVE_NGHTTP2 */ } bool sendH2Query(const std::shared_ptr& ds, std::unique_ptr& mplexer, std::shared_ptr& sender, InternalQuery&& query, bool healthCheck) { -#ifdef HAVE_NGHTTP2 +#if defined(HAVE_DNS_OVER_HTTPS) && defined(HAVE_NGHTTP2) struct timeval now { .tv_sec = 0, .tv_usec = 0 @@ -1077,24 +1077,24 @@ bool sendH2Query(const std::shared_ptr& ds, std::unique_ptr)) { @@ -1114,27 +1114,27 @@ size_t handleH2Timeouts(FDMultiplexer& mplexer, const struct timeval& now) ++got; } } -#endif /* HAVE_NGHTTP2 */ +#endif /* HAVE_DNS_OVER_HTTPS && HAVE_NGHTTP2 */ return got; } void setDoHDownstreamCleanupInterval(uint16_t max) { -#ifdef HAVE_NGHTTP2 +#if defined(HAVE_DNS_OVER_HTTPS) && defined(HAVE_NGHTTP2) DownstreamDoHConnectionsManager::setCleanupInterval(max); -#endif /* HAVE_NGHTTP2 */ +#endif /* HAVE_DNS_OVER_HTTPS && HAVE_NGHTTP2 */ } void setDoHDownstreamMaxIdleTime(uint16_t max) { -#ifdef HAVE_NGHTTP2 +#if defined(HAVE_DNS_OVER_HTTPS) && defined(HAVE_NGHTTP2) DownstreamDoHConnectionsManager::setMaxIdleTime(max); -#endif /* HAVE_NGHTTP2 */ +#endif /* HAVE_DNS_OVER_HTTPS && HAVE_NGHTTP2 */ } void setDoHDownstreamMaxIdleConnectionsPerBackend(size_t max) { -#ifdef HAVE_NGHTTP2 +#if defined(HAVE_DNS_OVER_HTTPS) && defined(HAVE_NGHTTP2) DownstreamDoHConnectionsManager::setMaxIdleConnectionsPerDownstream(max); -#endif /* HAVE_NGHTTP2 */ +#endif /* HAVE_DNS_OVER_HTTPS && HAVE_NGHTTP2 */ } diff --git a/pdns/dnsdistdist/test-dnsdistnghttp2-in_cc.cc b/pdns/dnsdistdist/test-dnsdistnghttp2-in_cc.cc index 2a479bf2be..27364fa370 100644 --- a/pdns/dnsdistdist/test-dnsdistnghttp2-in_cc.cc +++ b/pdns/dnsdistdist/test-dnsdistnghttp2-in_cc.cc @@ -29,7 +29,7 @@ #include "dnsdist-proxy-protocol.hh" #include "dnsdist-nghttp2-in.hh" -#ifdef HAVE_NGHTTP2 +#if defined(HAVE_DNS_OVER_HTTPS) && defined(HAVE_NGHTTP2) #include extern std::function& selectedBackend)> s_processQuery; @@ -736,4 +736,4 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_BackendTimeout, TestFixture) } BOOST_AUTO_TEST_SUITE_END(); -#endif /* HAVE_NGHTTP2 */ +#endif /* HAVE_DNS_OVER_HTTPS && HAVE_NGHTTP2 */ diff --git a/pdns/dnsdistdist/test-dnsdistnghttp2_cc.cc b/pdns/dnsdistdist/test-dnsdistnghttp2_cc.cc index b971e4ac15..858ce9e81f 100644 --- a/pdns/dnsdistdist/test-dnsdistnghttp2_cc.cc +++ b/pdns/dnsdistdist/test-dnsdistnghttp2_cc.cc @@ -31,7 +31,7 @@ #include "dnsdist-nghttp2.hh" #include "sstuff.hh" -#ifdef HAVE_NGHTTP2 +#if defined(HAVE_DNS_OVER_HTTPS) && defined(HAVE_NGHTTP2) #include BOOST_AUTO_TEST_SUITE(test_dnsdistnghttp2_cc) @@ -1846,4 +1846,4 @@ BOOST_FIXTURE_TEST_CASE(test_ProxyProtocol, TestFixture) } BOOST_AUTO_TEST_SUITE_END(); -#endif /* HAVE_NGHTTP2 */ +#endif /* HAVE_DNS_OVER_HTTPS && HAVE_NGHTTP2 */