Fix timing out DNS lookups that were already resolved

This could happen in the case of making repeated lookup requests
for the same thing within a short period of time: cleaning up an
old request that already got resolved would mistakenly see a new,
yet-to-be-resolved request with identical host/addr and mistakenly
assume it's in need of being timed out.
This commit is contained in:
Jon Siwek 2019-05-01 23:08:52 -07:00
parent fd11c63efe
commit 46799f7540
2 changed files with 15 additions and 8 deletions

View file

@ -1407,12 +1407,15 @@ void DNS_Mgr::DoProcess()
if ( req->time + DNS_TIMEOUT > current_time() )
break;
if ( req->IsAddrReq() )
CheckAsyncAddrRequest(req->host, true);
else if ( req->is_txt )
CheckAsyncTextRequest(req->name.c_str(), true);
else
CheckAsyncHostRequest(req->name.c_str(), true);
if ( ! req->processed )
{
if ( req->IsAddrReq() )
CheckAsyncAddrRequest(req->host, true);
else if ( req->is_txt )
CheckAsyncTextRequest(req->name.c_str(), true);
else
CheckAsyncHostRequest(req->name.c_str(), true);
}
asyncs_timeouts.pop();
delete req;