mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 07:23:53 +01:00
ircd::net::dns::cache:: Deinline waiter ctor.
This commit is contained in:
parent
9c68d01d86
commit
3157aa5405
2 changed files with 33 additions and 13 deletions
|
@ -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
|
||||
//
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue