0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-11 14:38:57 +02:00

ircd::net::dns: Remove explicit port argument from callback stack.

This commit is contained in:
Jason Volk 2020-03-05 14:15:14 -08:00
parent 33cafcdfa9
commit 5602a555d7

View file

@ -15,7 +15,7 @@ namespace ircd::net::dns
template<class T> static rfc1035::record *new_record(mutable_buffer &, const rfc1035::answer &);
static void handle_resolved(std::exception_ptr, const tag &, const answers &);
static void handle_resolve_A_ipport(const hostport &, const json::object &rr, opts, uint16_t, callback_ipport);
static void handle_resolve_A_ipport(const hostport &, const json::object &rr, opts, callback_ipport);
static void handle_resolve_SRV_ipport(const hostport &, const json::object &rr, opts, callback_ipport);
static void handle_resolve_one(const hostport &, const json::array &rr, callback_one);
}
@ -81,7 +81,7 @@ ircd::net::dns::resolve(const hostport &hp,
{
net::dns::callback_one handler
{
std::bind(&handle_resolve_A_ipport, ph::_1, ph::_2, opts, port(hp), std::move(callback))
std::bind(&handle_resolve_A_ipport, ph::_1, ph::_2, opts, std::move(callback))
};
resolve(hp, opts, std::move(handler));
@ -356,7 +356,7 @@ ircd::net::dns::handle_resolve_SRV_ipport(const hostport &hp,
opts.nxdomain_exceptions = true;
net::dns::callback_one handler
{
std::bind(&handle_resolve_A_ipport, ph::_1, ph::_2, opts, port(target), std::move(callback))
std::bind(&handle_resolve_A_ipport, ph::_1, ph::_2, opts, std::move(callback))
};
resolve(target, opts, std::move(handler));
@ -366,7 +366,6 @@ void
ircd::net::dns::handle_resolve_A_ipport(const hostport &hp,
const json::object &rr,
const opts opts,
const uint16_t port,
const callback_ipport callback)
{
const json::string &error
@ -383,12 +382,7 @@ ircd::net::dns::handle_resolve_A_ipport(const hostport &hp,
const ipport &ipport
{
ip, port
};
const hostport &target
{
host(hp), port
ip, port(hp)
};
const auto eptr
@ -400,7 +394,7 @@ ircd::net::dns::handle_resolve_A_ipport(const hostport &hp,
std::exception_ptr{}
};
callback(eptr, target, ipport);
callback(eptr, hp, ipport);
}
/// Called back from the dns::resolver with a vector of answers to the