]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
selection: only report RTT if there is an answer
authorŠtěpán Balážik <stepan.balazik@nic.cz>
Fri, 22 Jan 2021 18:22:20 +0000 (19:22 +0100)
committerŠtěpán Balážik <stepan.balazik@nic.cz>
Mon, 25 Jan 2021 14:42:55 +0000 (15:42 +0100)
Previously this would pollute the RTT cache with non-sensical
measurements from unsuccessful TCP connects for example.

daemon/worker.c

index 8f7382a4e08c8739b66200e107a363a82663823d..8a6d08b75aab0fdff88fe69d2dff42969fd082c7 100644 (file)
@@ -1599,7 +1599,7 @@ static int qr_task_step(struct qr_task *task,
        }
 
        // Report network RTT back to server selection
-       if (task->send_time && task->recv_time) {
+       if (packet && task->send_time && task->recv_time) {
                struct kr_query *qry = array_tail(req->rplan.pending);
                qry->server_selection.update_rtt(qry, task->transport, task->recv_time - task->send_time);
        }