From: Wouter Wijngaards Date: Thu, 29 Mar 2007 09:26:54 +0000 (+0000) Subject: iov used. X-Git-Tag: release-0.2~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e082f2ac48e78086f0d53ae20d468371cf3b3b5f;p=thirdparty%2Funbound.git iov used. git-svn-id: file:///svn/unbound/trunk@207 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/daemon/worker.c b/daemon/worker.c index 2158f71a3..1474aefb8 100644 --- a/daemon/worker.c +++ b/daemon/worker.c @@ -289,11 +289,11 @@ worker_handle_request(struct comm_point* c, void* arg, int error, if((e=slabhash_lookup(worker->daemon->msg_cache, h, &qinfo, 0))) { /* answer from cache */ log_info("answer from the cache"); - /* 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); + reply_info_answer_iov((struct reply_info*)e->data, + ldns_buffer_read_u16_at(c->buffer, 0), + ldns_buffer_read_u16_at(c->buffer, 2), repinfo); lock_rw_unlock(&e->lock); - return 1; + return 0; } ldns_buffer_rewind(c->buffer); /* perform memory allocation(s) */ diff --git a/doc/Changelog b/doc/Changelog index b5d001b79..f5414d62c 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,7 @@ +29 March 2007: Wouter + - writev or sendmsg used when answering from cache. + This avoids a copy of the data. + 28 March 2007: Wouter - new config option: num-queries-per-thread. - added tpkg test for answering three queries at the same time