Bug fix in DNS resolution. When the result is an error the result promise was being set twice.

This commit is contained in:
Stephen Atherton 2018-01-03 13:05:38 -08:00
parent fd3f3aa647
commit cec9f4d7a4
1 changed files with 4 additions and 1 deletions

View File

@ -838,8 +838,11 @@ ACTOR static Future<std::vector<NetworkAddress>> resolveTCPEndpoint_impl( Net2 *
state Promise<std::vector<NetworkAddress>> result;
self->tcpResolver.async_resolve(tcp::resolver::query(host, service), [=](const boost::system::error_code &ec, tcp::resolver::iterator iter) {
if(ec)
if(ec) {
result.sendError(lookup_failed());
return;
}
std::vector<NetworkAddress> addrs;
tcp::resolver::iterator end;