mirror of
https://github.com/matrix-construct/construct
synced 2024-11-26 08:42:34 +01:00
modules/s_dns: Minor cleanup; move error handling.
This commit is contained in:
parent
87025e7b41
commit
4070400261
1 changed files with 15 additions and 9 deletions
|
@ -801,7 +801,7 @@ ircd::net::dns::cache::call_waiters(const string_view &type,
|
|||
const json::array &rrs)
|
||||
{
|
||||
auto it(begin(waiting));
|
||||
while(it != end(waiting)) try
|
||||
while(it != end(waiting))
|
||||
{
|
||||
auto &waiter(*it);
|
||||
if(call_waiter(type, state_key, rrs, waiter))
|
||||
|
@ -809,14 +809,6 @@ ircd::net::dns::cache::call_waiters(const string_view &type,
|
|||
else
|
||||
++it;
|
||||
}
|
||||
catch(const std::exception &e)
|
||||
{
|
||||
++it;
|
||||
log::error
|
||||
{
|
||||
log, "proffer :%s", e.what()
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -824,6 +816,7 @@ ircd::net::dns::cache::call_waiter(const string_view &type,
|
|||
const string_view &state_key,
|
||||
const json::array &rrs,
|
||||
waiter &waiter)
|
||||
try
|
||||
{
|
||||
if(state_key != waiter.key)
|
||||
return false;
|
||||
|
@ -844,6 +837,19 @@ ircd::net::dns::cache::call_waiter(const string_view &type,
|
|||
waiter.callback(target, rrs);
|
||||
return true;
|
||||
}
|
||||
catch(const std::exception &e)
|
||||
{
|
||||
log::critical
|
||||
{
|
||||
log, "callback:%p %s,%s :%s",
|
||||
(const void *)&waiter,
|
||||
type,
|
||||
state_key,
|
||||
e.what(),
|
||||
};
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
// cache room creation
|
||||
|
|
Loading…
Reference in a new issue