From 9d9eee84025d0ee6c75cf0da46d063187ae8213f Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Mon, 30 Mar 2020 11:39:07 +0200 Subject: [PATCH] Fix uncached CLIENT_RESPONSE'es on stateful transports Because repinfo->c->buffer does not contain the response when the it did not came from cache. Only after tcp_req_info_send_reply is called, is the response on the buffer which is used to fill the dnstap protobuf's. --- util/netevent.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/util/netevent.c b/util/netevent.c index 090238384..e90987549 100644 --- a/util/netevent.c +++ b/util/netevent.c @@ -3153,18 +3153,18 @@ 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->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 } }