fixup locking in test code.

git-svn-id: file:///svn/unbound/trunk@629 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards 2007-09-21 13:55:07 +00:00
parent a81e19a6eb
commit 463bd32b26
2 changed files with 7 additions and 0 deletions

View file

@ -1,5 +1,6 @@
21 September 2007: Wouter
- fixup empty_DS_name allocated in wrong region.
- fixup testcode lock safety.
20 September 2007: Wouter
- fixup and test for NSEC wildcard with empty nonterminals.

View file

@ -93,7 +93,13 @@ entry_to_repinfo(struct entry* e, struct alloc_cache* alloc, struct region*
int ret;
struct edns_data edns;
entry_to_buf(e, pkt);
/* lock alloc lock to please lock checking software.
* alloc_special_obtain assumes it is talking to a ub-alloc,
* and does not need to perform locking. Here the alloc is
* the only one, so we lock it here */
lock_quick_lock(&alloc->lock);
ret = reply_info_parse(pkt, alloc, qi, rep, region, &edns);
lock_quick_unlock(&alloc->lock);
if(ret != 0) {
printf("parse code %d: %s\n", ret,
ldns_lookup_by_id(ldns_rcodes, ret)->name);