mirror of
https://github.com/matrix-construct/construct
synced 2025-02-27 14:10:13 +01:00
ircd::server: Remove extra format specifier; increase timer.
ircd::server: Assert that op_resolve not set when calling resolve(). ircd::server: Restore op state on unwind for exceptions.
This commit is contained in:
parent
5b28f51d1e
commit
cbd46e098b
1 changed files with 12 additions and 8 deletions
|
@ -70,12 +70,12 @@ ircd::server::wait_all()
|
||||||
[] { return !peer_unfinished(); }
|
[] { return !peer_unfinished(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
while(!dock.wait_for(seconds(4), finished))
|
while(!dock.wait_for(seconds(5), finished))
|
||||||
{
|
{
|
||||||
for(const auto &[name, peer] : peers)
|
for(const auto &[name, peer] : peers)
|
||||||
log::dwarning
|
log::dwarning
|
||||||
{
|
{
|
||||||
log, "Waiting for peer %s tags:%zu links:%zu err:%b op[r:%b f:%b] %s",
|
log, "Waiting for peer %s tags:%zu links:%zu err:%b op[r:%b f:%b]",
|
||||||
name,
|
name,
|
||||||
peer->tag_count(),
|
peer->tag_count(),
|
||||||
peer->link_count(),
|
peer->link_count(),
|
||||||
|
@ -1159,9 +1159,18 @@ ircd::server::peer::resolve(const hostport &hostport,
|
||||||
const net::dns::opts &opts)
|
const net::dns::opts &opts)
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if(op_resolve || op_fini)
|
assert(!op_resolve);
|
||||||
|
if(op_fini)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
const unwind::exceptional failure{[this]
|
||||||
|
{
|
||||||
|
op_resolve = false;
|
||||||
|
err_set(std::current_exception());
|
||||||
|
if(unlikely(ircd::run::level != ircd::run::level::RUN))
|
||||||
|
op_fini = true;
|
||||||
|
}};
|
||||||
|
|
||||||
// Skip DNS resolution for IP literals
|
// Skip DNS resolution for IP literals
|
||||||
if(rfc3986::valid(std::nothrow, rfc3986::parser::ip_address, host(hostport)))
|
if(rfc3986::valid(std::nothrow, rfc3986::parser::ip_address, host(hostport)))
|
||||||
{
|
{
|
||||||
|
@ -1200,11 +1209,6 @@ catch(const std::exception &e)
|
||||||
string(buf, hostport),
|
string(buf, hostport),
|
||||||
e.what()
|
e.what()
|
||||||
};
|
};
|
||||||
|
|
||||||
op_resolve = false;
|
|
||||||
err_set(std::current_exception());
|
|
||||||
if(unlikely(ircd::run::level != ircd::run::level::RUN))
|
|
||||||
op_fini = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Add table
Reference in a new issue