From: Wouter Wijngaards Date: Wed, 24 Mar 2010 14:44:35 +0000 (+0000) Subject: unbound control removed items are not counted again. X-Git-Tag: release-1.4.4rc1~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=efb19fd26a8c2c45c286403e1747d560b91e109c;p=thirdparty%2Funbound.git unbound control removed items are not counted again. git-svn-id: file:///svn/unbound/trunk@2061 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/daemon/remote.c b/daemon/remote.c index 7a6f5a6ff..1b415f024 100644 --- a/daemon/remote.c +++ b/daemon/remote.c @@ -1116,6 +1116,8 @@ struct del_info { size_t len; /** labels */ int labs; + /** now */ + uint32_t now; /** time to invalidate to */ uint32_t expired; /** number of rrsets removed */ @@ -1136,8 +1138,10 @@ zone_del_rrset(struct lruhash_entry* e, void* arg) if(dname_subdomain_c(k->rk.dname, inf->name)) { struct packed_rrset_data* d = (struct packed_rrset_data*)e->data; - d->ttl = inf->expired; - inf->num_rrsets++; + if(d->ttl >= inf->now) { + d->ttl = inf->expired; + inf->num_rrsets++; + } } } @@ -1150,8 +1154,10 @@ zone_del_msg(struct lruhash_entry* e, void* arg) struct msgreply_entry* k = (struct msgreply_entry*)e->key; if(dname_subdomain_c(k->key.qname, inf->name)) { struct reply_info* d = (struct reply_info*)e->data; - d->ttl = inf->expired; - inf->num_msgs++; + if(d->ttl >= inf->now) { + d->ttl = inf->expired; + inf->num_msgs++; + } } } @@ -1164,8 +1170,10 @@ zone_del_kcache(struct lruhash_entry* e, void* arg) struct key_entry_key* k = (struct key_entry_key*)e->key; if(dname_subdomain_c(k->name, inf->name)) { struct key_entry_data* d = (struct key_entry_data*)e->data; - d->ttl = inf->expired; - inf->num_keys++; + if(d->ttl >= inf->now) { + d->ttl = inf->expired; + inf->num_keys++; + } } } @@ -1185,6 +1193,7 @@ do_flush_zone(SSL* ssl, struct worker* worker, char* arg) inf.name = nm; inf.len = nmlen; inf.labs = nmlabs; + inf.now = *worker->env.now; inf.expired = *worker->env.now; inf.expired -= 3; /* handle 3 seconds skew between threads */ inf.num_rrsets = 0; diff --git a/doc/Changelog b/doc/Changelog index 7ef4a2596..3c292f9d0 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,6 @@ +24 March 2010: Wouter + - unbound control flushed items are not counted when flushed again. + 23 March 2010: Wouter - iana portlist updated.