From: Ensar Sarajčić Date: Thu, 12 Dec 2024 15:51:33 +0000 (+0100) Subject: dnsdist: fix formatting in dnsdist-lua.cc X-Git-Tag: dnsdist-2.0.0-alpha0^2~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=423251d25d553d85fb87bbd388bec3b251b95d6c;p=thirdparty%2Fpdns.git dnsdist: fix formatting in dnsdist-lua.cc --- diff --git a/pdns/dnsdistdist/dnsdist-lua.cc b/pdns/dnsdistdist/dnsdist-lua.cc index 1e432d31b0..bf7e179ed0 100644 --- a/pdns/dnsdistdist/dnsdist-lua.cc +++ b/pdns/dnsdistdist/dnsdist-lua.cc @@ -886,28 +886,29 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck) const std::function mutator; const size_t maximumValue{std::numeric_limits::max()}; }; - static const std::vector unsignedIntegerImmutableConfigItems{ + static const std::vector unsignedIntegerImmutableConfigItems + { {"setMaxTCPQueuedConnections", [](dnsdist::configuration::ImmutableConfiguration& config, uint64_t newValue) { config.d_maxTCPQueuedConnections = newValue; }, std::numeric_limits::max()}, - {"setMaxTCPClientThreads", [](dnsdist::configuration::ImmutableConfiguration& config, uint64_t newValue) { config.d_maxTCPClientThreads = newValue; }, std::numeric_limits::max()}, - {"setMaxTCPConnectionsPerClient", [](dnsdist::configuration::ImmutableConfiguration& config, uint64_t newValue) { config.d_maxTCPConnectionsPerClient = newValue; }, std::numeric_limits::max()}, - {"setTCPInternalPipeBufferSize", [](dnsdist::configuration::ImmutableConfiguration& config, uint64_t newValue) { config.d_tcpInternalPipeBufferSize = newValue; }, std::numeric_limits::max()}, - {"setMaxCachedTCPConnectionsPerDownstream", [](dnsdist::configuration::ImmutableConfiguration& config, uint64_t newValue) { config.d_outgoingTCPMaxIdlePerBackend = newValue; }, std::numeric_limits::max()}, - {"setTCPDownstreamCleanupInterval", [](dnsdist::configuration::ImmutableConfiguration& config, uint64_t newValue) { config.d_outgoingTCPCleanupInterval = newValue; }, std::numeric_limits::max()}, - {"setTCPDownstreamMaxIdleTime", [](dnsdist::configuration::ImmutableConfiguration& config, uint64_t newValue) { config.d_outgoingTCPMaxIdleTime = newValue; }, std::numeric_limits::max()}, + {"setMaxTCPClientThreads", [](dnsdist::configuration::ImmutableConfiguration& config, uint64_t newValue) { config.d_maxTCPClientThreads = newValue; }, std::numeric_limits::max()}, + {"setMaxTCPConnectionsPerClient", [](dnsdist::configuration::ImmutableConfiguration& config, uint64_t newValue) { config.d_maxTCPConnectionsPerClient = newValue; }, std::numeric_limits::max()}, + {"setTCPInternalPipeBufferSize", [](dnsdist::configuration::ImmutableConfiguration& config, uint64_t newValue) { config.d_tcpInternalPipeBufferSize = newValue; }, std::numeric_limits::max()}, + {"setMaxCachedTCPConnectionsPerDownstream", [](dnsdist::configuration::ImmutableConfiguration& config, uint64_t newValue) { config.d_outgoingTCPMaxIdlePerBackend = newValue; }, std::numeric_limits::max()}, + {"setTCPDownstreamCleanupInterval", [](dnsdist::configuration::ImmutableConfiguration& config, uint64_t newValue) { config.d_outgoingTCPCleanupInterval = newValue; }, std::numeric_limits::max()}, + {"setTCPDownstreamMaxIdleTime", [](dnsdist::configuration::ImmutableConfiguration& config, uint64_t newValue) { config.d_outgoingTCPMaxIdleTime = newValue; }, std::numeric_limits::max()}, #if defined(HAVE_DNS_OVER_HTTPS) && defined(HAVE_NGHTTP2) - {"setOutgoingDoHWorkerThreads", [](dnsdist::configuration::ImmutableConfiguration& config, uint64_t newValue) { config.d_outgoingDoHWorkers = newValue; }, std::numeric_limits::max()}, - {"setMaxIdleDoHConnectionsPerDownstream", [](dnsdist::configuration::ImmutableConfiguration& config, uint64_t newValue) { config.d_outgoingDoHMaxIdlePerBackend = newValue; }, std::numeric_limits::max()}, - {"setDoHDownstreamCleanupInterval", [](dnsdist::configuration::ImmutableConfiguration& config, uint64_t newValue) { config.d_outgoingDoHCleanupInterval = newValue; }, std::numeric_limits::max()}, - {"setDoHDownstreamMaxIdleTime", [](dnsdist::configuration::ImmutableConfiguration& config, uint64_t newValue) { config.d_outgoingDoHMaxIdleTime = newValue; }, std::numeric_limits::max()}, + {"setOutgoingDoHWorkerThreads", [](dnsdist::configuration::ImmutableConfiguration& config, uint64_t newValue) { config.d_outgoingDoHWorkers = newValue; }, std::numeric_limits::max()}, + {"setMaxIdleDoHConnectionsPerDownstream", [](dnsdist::configuration::ImmutableConfiguration& config, uint64_t newValue) { config.d_outgoingDoHMaxIdlePerBackend = newValue; }, std::numeric_limits::max()}, + {"setDoHDownstreamCleanupInterval", [](dnsdist::configuration::ImmutableConfiguration& config, uint64_t newValue) { config.d_outgoingDoHCleanupInterval = newValue; }, std::numeric_limits::max()}, + {"setDoHDownstreamMaxIdleTime", [](dnsdist::configuration::ImmutableConfiguration& config, uint64_t newValue) { config.d_outgoingDoHMaxIdleTime = newValue; }, std::numeric_limits::max()}, #endif /* HAVE_DNS_OVER_HTTPS && HAVE_NGHTTP2 */ - {"setMaxUDPOutstanding", [](dnsdist::configuration::ImmutableConfiguration& config, uint64_t newValue) { config.d_maxUDPOutstanding = newValue; }, std::numeric_limits::max()}, - {"setWHashedPertubation", [](dnsdist::configuration::ImmutableConfiguration& config, uint64_t newValue) { config.d_hashPerturbation = newValue; }, std::numeric_limits::max()}, + {"setMaxUDPOutstanding", [](dnsdist::configuration::ImmutableConfiguration& config, uint64_t newValue) { config.d_maxUDPOutstanding = newValue; }, std::numeric_limits::max()}, + {"setWHashedPertubation", [](dnsdist::configuration::ImmutableConfiguration& config, uint64_t newValue) { config.d_hashPerturbation = newValue; }, std::numeric_limits::max()}, #ifndef DISABLE_RECVMMSG - {"setUDPMultipleMessagesVectorSize", [](dnsdist::configuration::ImmutableConfiguration& config, uint64_t newValue) { config.d_udpVectorSize = newValue; }, std::numeric_limits::max()}, + {"setUDPMultipleMessagesVectorSize", [](dnsdist::configuration::ImmutableConfiguration& config, uint64_t newValue) { config.d_udpVectorSize = newValue; }, std::numeric_limits::max()}, #endif /* DISABLE_RECVMMSG */ - {"setUDPTimeout", [](dnsdist::configuration::ImmutableConfiguration& config, uint64_t newValue) { config.d_udpTimeout = newValue; }, std::numeric_limits::max()}, - {"setConsoleMaximumConcurrentConnections", [](dnsdist::configuration::ImmutableConfiguration& config, uint64_t newValue) { config.d_consoleMaxConcurrentConnections = newValue; }, std::numeric_limits::max()}, - {"setRingBuffersLockRetries", [](dnsdist::configuration::ImmutableConfiguration& config, uint64_t newValue) { config.d_ringsNbLockTries = newValue; }, std::numeric_limits::max()}, + {"setUDPTimeout", [](dnsdist::configuration::ImmutableConfiguration& config, uint64_t newValue) { config.d_udpTimeout = newValue; }, std::numeric_limits::max()}, + {"setConsoleMaximumConcurrentConnections", [](dnsdist::configuration::ImmutableConfiguration& config, uint64_t newValue) { config.d_consoleMaxConcurrentConnections = newValue; }, std::numeric_limits::max()}, + {"setRingBuffersLockRetries", [](dnsdist::configuration::ImmutableConfiguration& config, uint64_t newValue) { config.d_ringsNbLockTries = newValue; }, std::numeric_limits::max()}, }; struct DoubleImmutableConfigurationItems @@ -1602,7 +1603,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck) g_outputBuffer = "Crypto failed..\n"; } #else - g_outputBuffer = "Crypto not available.\n"; + g_outputBuffer = "Crypto not available.\n"; #endif }); @@ -2460,7 +2461,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck) #ifdef HAVE_NGHTTP2 frontend->d_library = "nghttp2"; #else /* HAVE_NGHTTP2 */ - frontend->d_library = "h2o"; + frontend->d_library = "h2o"; #endif /* HAVE_NGHTTP2 */ } if (frontend->d_library == "h2o") { @@ -2469,8 +2470,8 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck) // we _really_ need to set it again, as we just replaced the generic frontend by a new one frontend->d_library = "h2o"; #else /* HAVE_LIBH2OEVLOOP */ - errlog("DOH bind %s is configured to use libh2o but the library is not available", addr); - return; + errlog("DOH bind %s is configured to use libh2o but the library is not available", addr); + return; #endif /* HAVE_LIBH2OEVLOOP */ } else if (frontend->d_library == "nghttp2") { @@ -2587,7 +2588,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck) #ifdef HAVE_LIBSSL const std::string provider("openssl"); #else - const std::string provider("gnutls"); + const std::string provider("gnutls"); #endif vinfolog("Loading default TLS provider '%s'", provider); } @@ -2608,7 +2609,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck) config.d_frontends.push_back(std::move(clientState)); }); #else /* HAVE_DNS_OVER_HTTPS */ - throw std::runtime_error("addDOHLocal() called but DNS over HTTPS support is not present!"); + throw std::runtime_error("addDOHLocal() called but DNS over HTTPS support is not present!"); #endif /* HAVE_DNS_OVER_HTTPS */ }); @@ -2685,7 +2686,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck) config.d_frontends.push_back(std::move(clientState)); }); #else - throw std::runtime_error("addDOH3Local() called but DNS over HTTP/3 support is not present!"); + throw std::runtime_error("addDOH3Local() called but DNS over HTTP/3 support is not present!"); #endif }); @@ -2762,7 +2763,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck) config.d_frontends.push_back(std::move(clientState)); }); #else - throw std::runtime_error("addDOQLocal() called but DNS over QUIC support is not present!"); + throw std::runtime_error("addDOQLocal() called but DNS over QUIC support is not present!"); #endif }); @@ -2785,7 +2786,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck) throw; } #else - g_outputBuffer = "DNS over QUIC support is not present!\n"; + g_outputBuffer = "DNS over QUIC support is not present!\n"; #endif }); @@ -2844,7 +2845,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck) throw; } #else - g_outputBuffer = "DNS over HTTPS support is not present!\n"; + g_outputBuffer = "DNS over HTTPS support is not present!\n"; #endif }); @@ -2867,7 +2868,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck) throw; } #else - g_outputBuffer = "DNS over HTTP3 support is not present!\n"; + g_outputBuffer = "DNS over HTTP3 support is not present!\n"; #endif }); @@ -2937,7 +2938,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck) throw; } #else - g_outputBuffer = "DNS over HTTPS support is not present!\n"; + g_outputBuffer = "DNS over HTTPS support is not present!\n"; #endif }); @@ -3116,7 +3117,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck) #ifdef HAVE_LIBSSL const std::string provider("openssl"); #else - const std::string provider("gnutls"); + const std::string provider("gnutls"); #endif vinfolog("Loading default TLS provider '%s'", provider); } @@ -3142,7 +3143,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck) g_outputBuffer = "Error: " + string(e.what()) + "\n"; } #else - throw std::runtime_error("addTLSLocal() called but DNS over TLS support is not present!"); + throw std::runtime_error("addTLSLocal() called but DNS over TLS support is not present!"); #endif }); @@ -3166,7 +3167,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck) throw; } #else - g_outputBuffer = "DNS over TLS support is not present!\n"; + g_outputBuffer = "DNS over TLS support is not present!\n"; #endif });