mirror of
https://github.com/matrix-construct/construct
synced 2024-07-07 11:08:34 +02:00
ircd::net::dns: Use explicit static empty record instances.
This commit is contained in:
parent
fb53069c6f
commit
4c61eeba89
12
ircd/net.cc
12
ircd/net.cc
|
@ -2447,8 +2447,10 @@ ircd::net::dns::operator()(const hostport &hp,
|
||||||
operator()(hp, opts, [callback(std::move(callback))]
|
operator()(hp, opts, [callback(std::move(callback))]
|
||||||
(std::exception_ptr eptr, const hostport &hp, const vector_view<const rfc1035::record *> rrs)
|
(std::exception_ptr eptr, const hostport &hp, const vector_view<const rfc1035::record *> rrs)
|
||||||
{
|
{
|
||||||
|
static const rfc1035::record::SRV empty;
|
||||||
|
|
||||||
if(eptr)
|
if(eptr)
|
||||||
return callback(std::move(eptr), hp, {});
|
return callback(std::move(eptr), hp, empty);
|
||||||
|
|
||||||
//TODO: prng on weight / prio plz
|
//TODO: prng on weight / prio plz
|
||||||
for(size_t i(0); i < rrs.size(); ++i)
|
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, 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))]
|
operator()(hp, opts, [callback(std::move(callback))]
|
||||||
(std::exception_ptr eptr, const hostport &hp, const vector_view<const rfc1035::record *> rrs)
|
(std::exception_ptr eptr, const hostport &hp, const vector_view<const rfc1035::record *> rrs)
|
||||||
{
|
{
|
||||||
|
static const rfc1035::record::A empty;
|
||||||
|
|
||||||
if(eptr)
|
if(eptr)
|
||||||
return callback(std::move(eptr), hp, {});
|
return callback(std::move(eptr), hp, empty);
|
||||||
|
|
||||||
//TODO: prng plz
|
//TODO: prng plz
|
||||||
for(size_t i(0); i < rrs.size(); ++i)
|
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, record);
|
||||||
}
|
}
|
||||||
|
|
||||||
return callback(std::move(eptr), hp, {});
|
return callback(std::move(eptr), hp, empty);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue