From 8f4328073cb5f54521ff02918b430c8d0b59b804 Mon Sep 17 00:00:00 2001 From: Brad House Date: Tue, 6 Aug 2024 21:19:36 -0400 Subject: [PATCH] Query Timeout Calculation: Fix calculation when timeout > 1s --- src/lib/ares_metrics.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/ares_metrics.c b/src/lib/ares_metrics.c index aa0ea8c0..0e22fc37 100644 --- a/src/lib/ares_metrics.c +++ b/src/lib/ares_metrics.c @@ -170,7 +170,7 @@ void ares_metrics_record(const ares_query_t *query, ares_server_t *server, } ares__timeval_diff(&tvdiff, &query->ts, &now); - query_ms = (unsigned int)(tvdiff.sec + (tvdiff.usec / 1000)); + query_ms = (unsigned int)((tvdiff.sec * 1000) + (tvdiff.usec / 1000)); if (query_ms == 0) { query_ms = 1; }