reviewed yesterdays commit.

git-svn-id: file:///svn/unbound/trunk@191 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards 2007-03-23 08:25:43 +00:00
parent eba9696f4e
commit fdfe51464b
3 changed files with 11 additions and 2 deletions

View file

@ -292,6 +292,7 @@ worker_handle_request(struct comm_point* c, void* arg, int error,
/* id is still in the buffer, no need to touch it */
reply_info_answer((struct reply_info*)e->data,
ldns_buffer_read_u16_at(c->buffer, 2), c->buffer);
lock_rw_unlock(&e->lock);
return 1;
}
ldns_buffer_rewind(c->buffer);

View file

@ -1,3 +1,6 @@
23 March 2007: Wouter
- review of yesterday's commits.
22 March 2007: Wouter
- AIX configure check.
- lock-verify can handle references to locks that are created

View file

@ -88,8 +88,11 @@ int query_info_parse(struct query_info* m, ldns_buffer* query)
}
memmove(m->qname, q, m->qnamesize);
if(ldns_buffer_remaining(query) < 4)
if(ldns_buffer_remaining(query) < 4) {
free(m->qname);
m->qname = NULL;
return 0; /* need qtype, qclass */
}
m->qtype = ldns_buffer_read_u16(query);
m->qclass = ldns_buffer_read_u16(query);
return 1;
@ -186,7 +189,9 @@ struct msgreply_entry* query_info_entrysetup(struct query_info* q,
e->entry.key = e;
e->entry.data = r;
lock_rw_init(&e->entry.lock);
lock_protect(&e->entry.lock, e, sizeof(*e));
lock_protect(&e->entry.lock, &e->key, sizeof(e->key));
lock_protect(&e->entry.lock, &e->entry.hash, sizeof(e->entry.hash) +
sizeof(e->entry.key) + sizeof(e->entry.data));
lock_protect(&e->entry.lock, e->key.qname, e->key.qnamesize);
q->qname = NULL;
return e;