0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-26 15:33:54 +01:00

ircd::net::dns::cache:: Deinline waiter ctor.

This commit is contained in:
Jason Volk 2019-09-12 10:26:02 -07:00
parent 9c68d01d86
commit 3157aa5405
2 changed files with 33 additions and 13 deletions

View file

@ -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
//

View file

@ -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;