mirror of
https://github.com/NLnetLabs/unbound.git
synced 2026-09-13 13:27:43 +02:00
work on prefetch: store the updated results in the cache.
git-svn-id: file:///svn/unbound/trunk@1954 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
+7
-5
@@ -251,7 +251,7 @@ error_response_cache(struct module_qstate* qstate, int id, int rcode)
|
||||
/* do not waste time trying to validate this servfail */
|
||||
err.security = sec_status_indeterminate;
|
||||
verbose(VERB_ALGO, "store error response in message cache");
|
||||
if(!iter_dns_store(qstate->env, &qstate->qinfo, &err, 0)) {
|
||||
if(!iter_dns_store(qstate->env, &qstate->qinfo, &err, 0, 0)) {
|
||||
log_err("error_response_cache: could not store error (nomem)");
|
||||
}
|
||||
return error_response(qstate, id, rcode);
|
||||
@@ -1552,7 +1552,7 @@ processQueryResponse(struct module_qstate* qstate, struct iter_qstate* iq,
|
||||
* so they sent on their */
|
||||
verbose(VERB_DETAIL, "query response was ANSWER");
|
||||
if(!iter_dns_store(qstate->env, &iq->response->qinfo,
|
||||
iq->response->rep, 0))
|
||||
iq->response->rep, 0, qstate->prefetch_leeway))
|
||||
return error_response(qstate, id, LDNS_RCODE_SERVFAIL);
|
||||
/* close down outstanding requests to be discarded */
|
||||
outbound_list_clear(&iq->outlist);
|
||||
@@ -1589,8 +1589,9 @@ processQueryResponse(struct module_qstate* qstate, struct iter_qstate* iq,
|
||||
)
|
||||
)) {
|
||||
/* Store the referral under the current query */
|
||||
/* no prefetch-leeway, since its not the answer */
|
||||
if(!iter_dns_store(qstate->env, &iq->response->qinfo,
|
||||
iq->response->rep, 1))
|
||||
iq->response->rep, 1, 0))
|
||||
return error_response(qstate, id,
|
||||
LDNS_RCODE_SERVFAIL);
|
||||
if(qstate->env->neg_cache)
|
||||
@@ -1657,8 +1658,9 @@ processQueryResponse(struct module_qstate* qstate, struct iter_qstate* iq,
|
||||
/* cache the CNAME response under the current query */
|
||||
/* NOTE : set referral=1, so that rrsets get stored but not
|
||||
* the partial query answer (CNAME only). */
|
||||
/* prefetchleeway applied because this updates answer parts */
|
||||
if(!iter_dns_store(qstate->env, &iq->response->qinfo,
|
||||
iq->response->rep, 1))
|
||||
iq->response->rep, 1, qstate->prefetch_leeway))
|
||||
return error_response(qstate, id, LDNS_RCODE_SERVFAIL);
|
||||
/* set the current request's qname to the new value. */
|
||||
iq->qchase.qname = sname;
|
||||
@@ -2114,7 +2116,7 @@ processFinished(struct module_qstate* qstate, struct iter_qstate* iq,
|
||||
* from cache does not need to be stored in the msg cache. */
|
||||
if(qstate->query_flags&BIT_RD) {
|
||||
if(!iter_dns_store(qstate->env, &qstate->qinfo,
|
||||
iq->response->rep, 0))
|
||||
iq->response->rep, 0, qstate->prefetch_leeway))
|
||||
return error_response(qstate, id,
|
||||
LDNS_RCODE_SERVFAIL);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user