0
0
Fork 0
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:
Jason Volk 2018-10-23 11:22:27 -07:00
parent 68a136c85d
commit bf4cdbf878

View file

@ -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));
}
//