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) */
+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