]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Fixup prefetch only when needed
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Mon, 24 Oct 2016 12:53:13 +0000 (12:53 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Mon, 24 Oct 2016 12:53:13 +0000 (12:53 +0000)
git-svn-id: file:///svn/unbound/trunk@3904 be551aaa-1e26-0410-a405-d3ace91eadb9

daemon/worker.c

index 59fccf5534aa64240e8483f7e0e0cea1aabf6fc9..3c50567e4ed58d7c08eceaac86dda8f9fcb90241 100644 (file)
@@ -1027,9 +1027,9 @@ worker_handle_request(struct comm_point* c, void* arg, int error,
                        sldns_buffer_read_u16_at(c->buffer, 2), repinfo, 
                        &edns)) {
                        /* prefetch it if the prefetch TTL expired */
-                       if((worker->env.cfg->prefetch && *worker->env.now >=
-                               ((struct reply_info*)e->data)->prefetch_ttl)
-                               || worker->env.cfg->serve_expired) {
+                       if((worker->env.cfg->prefetch || worker->env.cfg->serve_expired)
+                               && *worker->env.now >=
+                               ((struct reply_info*)e->data)->prefetch_ttl) {
                                time_t leeway = ((struct reply_info*)e->
                                        data)->ttl - *worker->env.now;
                                if(((struct reply_info*)e->data)->ttl