]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Fix uncached CLIENT_RESPONSE'es on stateful transports
authorWillem Toorop <willem@nlnetlabs.nl>
Mon, 30 Mar 2020 09:39:07 +0000 (11:39 +0200)
committerWillem Toorop <willem@nlnetlabs.nl>
Mon, 30 Mar 2020 09:39:07 +0000 (11:39 +0200)
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

index 090238384912efd3a5a95f109abb8752c6ed8f2f..e909875498f84269275c5badd530e1b7b15a6339 100644 (file)
@@ -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
        }
 }