return result;
});
- luaCtx.registerFunction<boost::optional<std::shared_ptr<DNSCryptCertificatePair>> (std::shared_ptr<DNSCryptContext>::*)(size_t idx)>("getCertificatePair", [](std::shared_ptr<DNSCryptContext>& ctx, size_t idx) -> boost::optional<std::shared_ptr<DNSCryptCertificatePair>> {
+ luaCtx.registerFunction<boost::optional<std::shared_ptr<DNSCryptCertificatePair>> (std::shared_ptr<DNSCryptContext>::*)(size_t idx)>("getCertificatePair", [](std::shared_ptr<DNSCryptContext>& ctx, size_t idx) {
if (ctx == nullptr) {
throw std::runtime_error("DNSCryptContext::getCertificatePair() called on a nil value");
}
return dnsdist::queueQueryResumptionEvent(std::move(query));
});
- luaCtx.registerFunction<boost::optional<std::shared_ptr<DownstreamState>> (DNSResponse::*)(void) const>("getSelectedBackend", [](const DNSResponse& dnsResponse) -> boost::optional<std::shared_ptr<DownstreamState>> {
+ luaCtx.registerFunction<boost::optional<std::shared_ptr<DownstreamState>> (DNSResponse::*)(void) const>("getSelectedBackend", [](const DNSResponse& dnsResponse) {
return dnsResponse.d_downstream ? dnsResponse.d_downstream : boost::optional<std::shared_ptr<DownstreamState>>();
});
g_outputBuffer = ret.str();
});
- luaCtx.writeFunction("getDNSCryptBind", [](uint64_t idx) -> boost::optional<std::shared_ptr<DNSCryptContext>> {
+ luaCtx.writeFunction("getDNSCryptBind", [](uint64_t idx) {
setLuaNoSideEffect();
boost::optional<std::shared_ptr<DNSCryptContext>> ret{boost::none};
/* we are only interested in distinct DNSCrypt binds,
}
});
- luaCtx.writeFunction("getBind", [](uint64_t num) -> boost::optional<ClientState*> {
+ luaCtx.writeFunction("getBind", [](uint64_t num) {
setLuaNoSideEffect();
boost::optional<ClientState*> ret{boost::none};
auto frontends = dnsdist::getFrontends();
});
#ifdef HAVE_DNS_OVER_QUIC
- luaCtx.writeFunction("getDOQFrontend", [client](uint64_t index) -> boost::optional<std::shared_ptr<DOQFrontend>> {
+ luaCtx.writeFunction("getDOQFrontend", [client](uint64_t index) {
boost::optional<std::shared_ptr<DOQFrontend>> result{boost::none};
if (client) {
return result;
});
#ifdef HAVE_DNS_OVER_HTTP3
- luaCtx.writeFunction("getDOH3Frontend", [client](uint64_t index) -> boost::optional<std::shared_ptr<DOH3Frontend>> {
+ luaCtx.writeFunction("getDOH3Frontend", [client](uint64_t index) {
boost::optional<std::shared_ptr<DOH3Frontend>> result{boost::none};
if (client) {
return result;
#endif
});
- luaCtx.writeFunction("getDOHFrontend", [client]([[maybe_unused]] uint64_t index) -> boost::optional<std::shared_ptr<DOHFrontend>> {
+ luaCtx.writeFunction("getDOHFrontend", [client]([[maybe_unused]] uint64_t index) {
boost::optional<std::shared_ptr<DOHFrontend>> result{boost::none};
if (client) {
return result;
#endif
});
- luaCtx.writeFunction("getTLSFrontend", []([[maybe_unused]] uint64_t index) -> boost::optional<std::shared_ptr<TLSFrontend>> {
+ luaCtx.writeFunction("getTLSFrontend", []([[maybe_unused]] uint64_t index) {
boost::optional<std::shared_ptr<TLSFrontend>> result{boost::none};
#ifdef HAVE_DNS_OVER_TLS
setLuaNoSideEffect();