0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-07-04 17:48:35 +02:00

ircd::net::dns: Use explicit static empty record instances.

This commit is contained in:
Jason Volk 2018-05-02 11:28:34 -07:00
parent fb53069c6f
commit 4c61eeba89

View file

@ -2447,8 +2447,10 @@ ircd::net::dns::operator()(const hostport &hp,
operator()(hp, opts, [callback(std::move(callback))]
(std::exception_ptr eptr, const hostport &hp, const vector_view<const rfc1035::record *> rrs)
{
static const rfc1035::record::SRV empty;
if(eptr)
return callback(std::move(eptr), hp, {});
return callback(std::move(eptr), hp, empty);
//TODO: prng on weight / prio plz
for(size_t i(0); i < rrs.size(); ++i)
@ -2461,7 +2463,7 @@ ircd::net::dns::operator()(const hostport &hp,
return callback(std::move(eptr), hp, record);
}
return callback(std::move(eptr), hp, {});
return callback(std::move(eptr), hp, empty);
});
}
@ -2476,8 +2478,10 @@ ircd::net::dns::operator()(const hostport &hp,
operator()(hp, opts, [callback(std::move(callback))]
(std::exception_ptr eptr, const hostport &hp, const vector_view<const rfc1035::record *> rrs)
{
static const rfc1035::record::A empty;
if(eptr)
return callback(std::move(eptr), hp, {});
return callback(std::move(eptr), hp, empty);
//TODO: prng plz
for(size_t i(0); i < rrs.size(); ++i)
@ -2490,7 +2494,7 @@ ircd::net::dns::operator()(const hostport &hp,
return callback(std::move(eptr), hp, record);
}
return callback(std::move(eptr), hp, {});
return callback(std::move(eptr), hp, empty);
});
}