From 3157aa5405439b11c46df13fcdbcab6423ba2d87 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Thu, 12 Sep 2019 10:26:02 -0700 Subject: [PATCH] ircd::net::dns::cache:: Deinline waiter ctor. --- modules/net_dns.cc | 31 +++++++++++++++++++++++++++++++ modules/net_dns.h | 15 ++------------- 2 files changed, 33 insertions(+), 13 deletions(-) diff --git a/modules/net_dns.cc b/modules/net_dns.cc index 58fa66ead..3b7ba7026 100644 --- a/modules/net_dns.cc +++ b/modules/net_dns.cc @@ -964,6 +964,37 @@ catch(const std::exception &e) return true; } +// +// cache::waiter +// + +ircd::net::dns::cache::waiter::waiter(const hostport &hp, + const dns::opts &opts, + dns::callback &&callback) +:callback +{ + std::move(callback) +} +,opts +{ + opts +} +,port +{ + net::port(hp) +} +,key +{ + opts.qtype == 33? + make_SRV_key(keybuf, hp, opts): + strlcpy(keybuf, host(hp)) +} +{ + this->opts.srv = {}; + this->opts.proto = {}; + assert(this->opts.qtype); +} + // // cache room creation // diff --git a/modules/net_dns.h b/modules/net_dns.h index ca24b8b93..cfcc93f31 100644 --- a/modules/net_dns.h +++ b/modules/net_dns.h @@ -58,22 +58,11 @@ struct ircd::net::dns::cache::waiter { dns::callback callback; dns::opts opts; - uint16_t port {0}; + uint16_t port; string_view key; char keybuf[rfc1035::NAME_BUFSIZE*2]; - waiter(const hostport &hp, const dns::opts &opts, dns::callback &&callback) - :callback{std::move(callback)} - ,opts{opts} - ,port{net::port(hp)} - ,key - { - opts.qtype == 33? - make_SRV_key(keybuf, hp, opts): - strlcpy(keybuf, host(hp)) - } - {} - + waiter(const hostport &hp, const dns::opts &opts, dns::callback &&callback); waiter(waiter &&) = delete; waiter(const waiter &) = delete; waiter &operator=(waiter &&) = delete;