mirror of
https://github.com/NLnetLabs/unbound.git
synced 2025-12-20 23:00:56 -05:00
python mod invalidate routine fix.
git-svn-id: file:///svn/unbound/trunk@1589 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
parent
93f6117ab2
commit
397985b2c8
2 changed files with 16 additions and 10 deletions
|
|
@ -10,6 +10,7 @@
|
|||
/usr/lib/python2.x/site-packages/_unbound.so*
|
||||
The example python scripts (pythonmod/examples and
|
||||
libunbound/python/examples) are not installed.
|
||||
- python invalidate routine respects packed rrset ids and locks.
|
||||
|
||||
3 April 2009: Wouter
|
||||
- Fixed a bug that caused messages to be stored in the cache too
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@
|
|||
#include "util/module.h"
|
||||
#include "util/net_help.h"
|
||||
#include "services/cache/dns.h"
|
||||
#include "services/cache/rrset.h"
|
||||
#include "util/data/msgparse.h"
|
||||
#include "util/data/msgreply.h"
|
||||
#include "util/storage/slabhash.h"
|
||||
|
|
@ -78,9 +79,11 @@ void invalidateQueryInCache(struct module_qstate* qstate, struct query_info* qin
|
|||
if (r)
|
||||
{
|
||||
r->ttl = 0;
|
||||
if(rrset_array_lock(r->ref, r->rrset_count, *qstate->env->now)) {
|
||||
for(i=0; i< r->rrset_count; i++)
|
||||
{
|
||||
struct packed_rrset_data* data = (struct packed_rrset_data*) r->ref[i].key->entry.data;
|
||||
struct packed_rrset_data* data =
|
||||
(struct packed_rrset_data*) r->ref[i].key->entry.data;
|
||||
if(i>0 && r->ref[i].key == r->ref[i-1].key)
|
||||
continue;
|
||||
|
||||
|
|
@ -88,6 +91,8 @@ void invalidateQueryInCache(struct module_qstate* qstate, struct query_info* qin
|
|||
for(j=0; j<data->count + data->rrsig_count; j++)
|
||||
data->rr_ttl[j] = r->ttl;
|
||||
}
|
||||
rrset_array_unlock(r->ref, r->rrset_count);
|
||||
}
|
||||
}
|
||||
lock_rw_unlock(&e->lock);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue