mirror of
https://github.com/matrix-construct/construct
synced 2024-11-25 16:22:35 +01:00
modules/s_dns_resolver: Additional checks before allowing entry to resolver.
This commit is contained in:
parent
68a136c85d
commit
bf4cdbf878
1 changed files with 9 additions and 1 deletions
|
@ -86,7 +86,15 @@ ircd::net::dns::resolver_call(const hostport &hp,
|
|||
host(hp)
|
||||
};
|
||||
|
||||
(*resolver)(hp, opts, std::move(cb));
|
||||
auto &resolver{*dns::resolver};
|
||||
if(unlikely(!resolver.ns.is_open()))
|
||||
throw error
|
||||
{
|
||||
"Cannot resolve '%s': resolver is closed.",
|
||||
host(hp)
|
||||
};
|
||||
|
||||
resolver(hp, opts, std::move(cb));
|
||||
}
|
||||
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue