mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 07:23:53 +01:00
ircd::server: Split link opening routine from resolver handler.
This commit is contained in:
parent
a9cff4f073
commit
d149c540f4
2 changed files with 20 additions and 1 deletions
|
@ -43,6 +43,7 @@ struct ircd::server::peer
|
|||
template<class F> size_t accumulate_tags(F&&) const;
|
||||
|
||||
void handle_finished();
|
||||
void open_links();
|
||||
void handle_resolve_A(const hostport &, const json::array &);
|
||||
void handle_resolve_SRV(const hostport &, const json::array &);
|
||||
void resolve(const hostport &, const net::dns::opts &);
|
||||
|
|
|
@ -1110,7 +1110,25 @@ try
|
|||
|
||||
open_opts.ipport = this->remote;
|
||||
port(open_opts.hostport) = port(this->remote);
|
||||
open_links();
|
||||
}
|
||||
catch(const std::exception &e)
|
||||
{
|
||||
log::derror
|
||||
{
|
||||
log, "peer(%p) resolve A/AAAA: %s",
|
||||
this,
|
||||
e.what()
|
||||
};
|
||||
|
||||
const ctx::exception_handler eh;
|
||||
close();
|
||||
}
|
||||
|
||||
void
|
||||
ircd::server::peer::open_links()
|
||||
try
|
||||
{
|
||||
// The hostname in open_opts should still reference this object's string.
|
||||
assert(host(open_opts.hostport).data() == this->hostcanon.data());
|
||||
|
||||
|
@ -1123,7 +1141,7 @@ catch(const std::exception &e)
|
|||
{
|
||||
log::derror
|
||||
{
|
||||
log, "peer(%p) resolve A/AAAA: %s",
|
||||
log, "peer(%p) open links: %s",
|
||||
this,
|
||||
e.what()
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue