mirror of
https://github.com/zeek/zeek.git
synced 2025-10-11 11:08:20 +00:00
Make sure lookup_hostname_txt isn't checking lookup_hostname's cache for answers.
This commit is contained in:
parent
d9803a0d9d
commit
a1c0b853fe
1 changed files with 31 additions and 15 deletions
|
@ -1055,21 +1055,38 @@ void DNS_Mgr::AsyncLookupName(string name, LookupCallback* callback, bool is_txt
|
||||||
}
|
}
|
||||||
|
|
||||||
AsyncRequest* req = 0;
|
AsyncRequest* req = 0;
|
||||||
|
if ( is_txt )
|
||||||
// Have we already a request waiting for this host?
|
{
|
||||||
AsyncRequestNameMap::iterator i = asyncs_names.find(name);
|
// Have we already a request waiting for this host?
|
||||||
if ( i != asyncs_names.end() )
|
AsyncRequestTextMap::iterator i = asyncs_texts.find(name);
|
||||||
req = i->second;
|
if ( i != asyncs_texts.end() )
|
||||||
else
|
req = i->second;
|
||||||
{
|
else
|
||||||
// A new one.
|
{
|
||||||
req = new AsyncRequest;
|
// A new one.
|
||||||
req->name = name;
|
req = new AsyncRequest;
|
||||||
req->is_txt = is_txt;
|
req->name = name;
|
||||||
asyncs_queued.push_back(req);
|
req->is_txt = is_txt;
|
||||||
asyncs_names.insert(AsyncRequestNameMap::value_type(name, req));
|
asyncs_queued.push_back(req);
|
||||||
|
asyncs_texts.insert(AsyncRequestTextMap::value_type(name, req));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Have we already a request waiting for this host?
|
||||||
|
AsyncRequestNameMap::iterator i = asyncs_names.find(name);
|
||||||
|
if ( i != asyncs_names.end() )
|
||||||
|
req = i->second;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// A new one.
|
||||||
|
req = new AsyncRequest;
|
||||||
|
req->name = name;
|
||||||
|
req->is_txt = is_txt;
|
||||||
|
asyncs_queued.push_back(req);
|
||||||
|
asyncs_names.insert(AsyncRequestNameMap::value_type(name, req));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
req->callbacks.push_back(callback);
|
req->callbacks.push_back(callback);
|
||||||
|
|
||||||
IssueAsyncRequests();
|
IssueAsyncRequests();
|
||||||
|
@ -1170,7 +1187,6 @@ void DNS_Mgr::CheckAsyncTextRequest(const char* host, bool timeout)
|
||||||
// Note that this code is a mirror of that for CheckAsyncAddrRequest.
|
// Note that this code is a mirror of that for CheckAsyncAddrRequest.
|
||||||
|
|
||||||
AsyncRequestTextMap::iterator i = asyncs_texts.find(host);
|
AsyncRequestTextMap::iterator i = asyncs_texts.find(host);
|
||||||
|
|
||||||
if ( i != asyncs_texts.end() )
|
if ( i != asyncs_texts.end() )
|
||||||
{
|
{
|
||||||
const char* name = LookupTextInCache(host);
|
const char* name = LookupTextInCache(host);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue