diff --git a/include/ircd/net/dns.h b/include/ircd/net/dns.h index faa064347..2e90e976d 100644 --- a/include/ircd/net/dns.h +++ b/include/ircd/net/dns.h @@ -45,6 +45,11 @@ struct ircd::net::dns bool query_cache(const hostport &, const opts &, const callback &); public: + // Cache warming + static const callback_A_one prefetch_A; + static const callback_SRV_one prefetch_SRV; + static const callback_ipport_one prefetch_ipport; + // Callback-based interface void operator()(const hostport &, const opts &, callback); void operator()(const hostport &, const opts &, callback_A_one); diff --git a/ircd/net.cc b/ircd/net.cc index e273a25ae..1c1825702 100644 --- a/ircd/net.cc +++ b/ircd/net.cc @@ -2308,6 +2308,27 @@ ircd::net::dns::cache::clear_nxdomain { "default", 43200L }, }; +decltype(ircd::net::dns::prefetch_ipport) +ircd::net::dns::prefetch_ipport{[] +(std::exception_ptr, const auto &record) +{ + // Do nothing; cache already updated if necessary +}}; + +decltype(ircd::net::dns::prefetch_SRV) +ircd::net::dns::prefetch_SRV{[] +(std::exception_ptr, const auto &record) +{ + // Do nothing; cache already updated if necessary +}}; + +decltype(ircd::net::dns::prefetch_A) +ircd::net::dns::prefetch_A{[] +(std::exception_ptr, const auto &record) +{ + // Do nothing; cache already updated if necessary +}}; + /// Convenience composition with a single ipport callback. This is the result of /// an automatic chain of queries such as SRV and A/AAAA based on the input and /// intermediate results.