]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Send tcp_req_info->spool_buffer as dnstap CLIENT_RESPONSE 208/head
authorWillem Toorop <willem@nlnetlabs.nl>
Mon, 30 Mar 2020 10:19:17 +0000 (12:19 +0200)
committerWillem Toorop <willem@nlnetlabs.nl>
Mon, 30 Mar 2020 10:19:17 +0000 (12:19 +0200)
When tcp_req_info exists. This fixes that dnstap CLIENT_RESPONSE messages did not contain the response message when answering on statful transport for uncached responses.

util/netevent.c

index e909875498f84269275c5badd530e1b7b15a6339..f7bb9b8979351132de629e114c7ff7391a4fdac1 100644 (file)
@@ -3153,18 +3153,21 @@ comm_point_send_reply(struct comm_reply *repinfo)
                        &repinfo->addr, repinfo->c->type, repinfo->c->buffer);
 #endif
        } else {
+#ifdef USE_DNSTAP
+               if(repinfo->c->tcp_parent->dtenv != NULL &&
+                  repinfo->c->tcp_parent->dtenv->log_client_response_messages)
+                       dt_msg_send_client_response(repinfo->c->tcp_parent->dtenv,
+                       &repinfo->addr, repinfo->c->type,
+                       ( repinfo->c->tcp_req_info
+                       ? repinfo->c->tcp_req_info->spool_buffer
+                       : repinfo->c->buffer ));
+#endif
                if(repinfo->c->tcp_req_info) {
                        tcp_req_info_send_reply(repinfo->c->tcp_req_info);
                } else {
                        comm_point_start_listening(repinfo->c, -1,
                                repinfo->c->tcp_timeout_msec);
                }
-#ifdef USE_DNSTAP
-               if(repinfo->c->tcp_parent->dtenv != NULL &&
-                  repinfo->c->tcp_parent->dtenv->log_client_response_messages)
-                       dt_msg_send_client_response(repinfo->c->tcp_parent->dtenv,
-                       &repinfo->addr, repinfo->c->type, repinfo->c->buffer);
-#endif
        }
 }