Skip to content

Commit 2b2eae7

Browse files
committed
Query Timeout Calculation: Fix calculation when timeout > 1s
1 parent b7a89b9 commit 2b2eae7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib/ares_metrics.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ void ares_metrics_record(const ares_query_t *query, ares_server_t *server,
170170
}
171171

172172
ares__timeval_diff(&tvdiff, &query->ts, &now);
173-
query_ms = (unsigned int)(tvdiff.sec + (tvdiff.usec / 1000));
173+
query_ms = (unsigned int)((tvdiff.sec * 1000) + (tvdiff.usec / 1000));
174174
if (query_ms == 0) {
175175
query_ms = 1;
176176
}

0 commit comments

Comments
 (0)