BOOST_CHECK_EQUAL(g_negCache->size(), 2U);
}
-BOOST_AUTO_TEST_CASE(test_skip_negcache_for_variable_response)
+BOOST_AUTO_TEST_CASE(test_dont_skip_negcache_for_variable_response)
{
std::unique_ptr<SyncRes> sr;
initSR(sr);
int res = sr->beginResolve(target, QType(QType::A), QClass::IN, ret);
BOOST_CHECK_EQUAL(res, RCode::NXDomain);
BOOST_CHECK_EQUAL(ret.size(), 2U);
- /* no negative cache entry because the response was variable */
- BOOST_CHECK_EQUAL(g_negCache->size(), 0U);
+ BOOST_CHECK_EQUAL(g_negCache->size(), 1U);
}
BOOST_AUTO_TEST_CASE(test_ecs_cache_limit_allowed)
and do an additional query for the CNAME target.
We have a regression test making sure we do exactly that.
*/
- if (!wasVariable() && newtarget.empty() && putInNegCache) {
+ if (newtarget.empty() && putInNegCache) {
g_negCache->add(ne);
if (s_rootNXTrust && ne.d_auth.isRoot() && auth.isRoot() && lwr.d_aabit) {
ne.d_name = ne.d_name.getLastLabel();
}
LOG(prefix<<qname<<": got negative indication of DS record for '"<<newauth<<"'"<<endl);
- if (!wasVariable()) {
- g_negCache->add(ne);
- }
+ g_negCache->add(ne);
/* Careful! If the client is asking for a DS that does not exist, we need to provide the SOA along with the NSEC(3) proof
and we might not have it if we picked up the proof from a delegation, in which case we need to keep on to do the actual DS
}
ne.d_ttd = d_now.tv_sec + lowestTTL;
- if (!wasVariable()) {
- if (qtype.getCode()) { // prevents us from NXDOMAIN'ing a whole domain
- g_negCache->add(ne);
- }
+ if (qtype.getCode()) { // prevents us from NXDOMAIN'ing a whole domain
+ g_negCache->add(ne);
}
ret.push_back(rec);