unbound control removed items are not counted again.

git-svn-id: file:///svn/unbound/trunk@2061 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards 2010-03-24 14:44:35 +00:00
parent bc4770ea7d
commit efb19fd26a
2 changed files with 18 additions and 6 deletions

View file

@ -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,10 +1138,12 @@ 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;
if(d->ttl >= inf->now) {
d->ttl = inf->expired;
inf->num_rrsets++;
}
}
}
/** callback to delete messages in a zone */
static void
@ -1150,10 +1154,12 @@ 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;
if(d->ttl >= inf->now) {
d->ttl = inf->expired;
inf->num_msgs++;
}
}
}
/** callback to delete keys in zone */
static void
@ -1164,10 +1170,12 @@ 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;
if(d->ttl >= inf->now) {
d->ttl = inf->expired;
inf->num_keys++;
}
}
}
/** remove all rrsets and keys from zone from cache */
static void
@ -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;

View file

@ -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.