mirror of
https://github.com/matrix-construct/construct
synced 2024-11-16 06:51:08 +01:00
ircd::net::dns: Remove explicit port argument from callback stack.
This commit is contained in:
parent
33cafcdfa9
commit
5602a555d7
1 changed files with 5 additions and 11 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue