]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
iov used.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 29 Mar 2007 09:26:54 +0000 (09:26 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 29 Mar 2007 09:26:54 +0000 (09:26 +0000)
git-svn-id: file:///svn/unbound/trunk@207 be551aaa-1e26-0410-a405-d3ace91eadb9

daemon/worker.c
doc/Changelog

index 2158f71a3caa66786919bd9280f1c3d7a185935c..1474aefb8ee8a3b3af05f7b5db1e052b0350fdb6 100644 (file)
@@ -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) */
index b5d001b79340f887908d1a801120f8cfd03a254d..f5414d62c8969a2e6ba318f5cbd1b9fde3060d04 100644 (file)
@@ -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