]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix another spoolbuf storage code point, in prefetch. release-1.9.2rc3
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 12 Jun 2019 06:32:45 +0000 (08:32 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 12 Jun 2019 06:32:45 +0000 (08:32 +0200)
daemon/worker.c
doc/Changelog
util/netevent.c

index fc93817a040c9608c980a55a700e6393402bc5aa..661f6967d41d031c73b2c119acd5e423aa2dc067 100644 (file)
@@ -772,8 +772,14 @@ reply_and_prefetch(struct worker* worker, struct query_info* qinfo,
 {
        /* first send answer to client to keep its latency 
         * as small as a cachereply */
-       if(sldns_buffer_limit(repinfo->c->buffer) != 0)
+       if(sldns_buffer_limit(repinfo->c->buffer) != 0) {
+               if(repinfo->c->tcp_req_info) {
+                       sldns_buffer_copy(
+                               repinfo->c->tcp_req_info->spool_buffer,
+                               repinfo->c->buffer);
+               }
                comm_point_send_reply(repinfo);
+       }
        server_stats_prefetch(&worker->stats, worker);
        
        /* create the prefetch in the mesh as a normal lookup without
index 683ddc2b37d88bdcdf226fbb9904f0e8a9b92598..eed029034385a6f69225aef771026ad1039b1bd0 100644 (file)
@@ -1,3 +1,6 @@
+12 June 2019: Wouter
+       - Fix another spoolbuf storage code point, in prefetch.
+
 11 June 2019: Wouter
        - Fix that fixes the Fix that spoolbuf is not used to store tcp
          pipelined response between mesh send and callback end, this fixes
index 665b5b0d2523caed5c0f1fab9670e573a6c38d69..9e2ba92b5fdfa5b5a83f90e3b2865362fa9e4783 100644 (file)
@@ -1567,7 +1567,6 @@ comm_point_tcp_handle_write(int fd, struct comm_point* c)
                iov[1].iov_base = sldns_buffer_begin(buffer);
                iov[1].iov_len = sldns_buffer_limit(buffer);
                log_assert(iov[0].iov_len > 0);
-               log_assert(iov[1].iov_len > 0);
                msg.msg_name = &c->repinfo.addr;
                msg.msg_namelen = c->repinfo.addrlen;
                msg.msg_iov = iov;
@@ -1634,7 +1633,6 @@ comm_point_tcp_handle_write(int fd, struct comm_point* c)
                iov[1].iov_base = sldns_buffer_begin(buffer);
                iov[1].iov_len = sldns_buffer_limit(buffer);
                log_assert(iov[0].iov_len > 0);
-               log_assert(iov[1].iov_len > 0);
                r = writev(fd, iov, 2);
 #else /* HAVE_WRITEV */
                r = send(fd, (void*)(((uint8_t*)&len)+c->tcp_byte_count),