0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-25 16:22:35 +01:00

modules/s_dns: Handle case for entirely irrelevant records.

This commit is contained in:
Jason Volk 2019-03-22 13:30:55 -07:00
parent 8f41687940
commit 4ec689ef65

View file

@ -343,6 +343,19 @@ try
s = e;
}
}
// We have to send something to the cache with the same type
// as the query, otherwise our user will never get a response
// to what they're waiting for.
bool has_tag_qtype{false};
for(size_t i(0); i < an.size() && !has_tag_qtype; ++i)
has_tag_qtype = an.at(i).qtype == tag.opts.qtype;
if(!has_tag_qtype)
{
static const records empty;
cache::put(tag.hp, tag.opts, empty);
}
}
catch(const std::exception &e)
{