Query Timeout Calculation: Fix calculation when timeout > 1s

pull/857/head
Brad House 4 months ago
parent 6b230153b7
commit 8f4328073c
  1. 2
      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;
}

Loading…
Cancel
Save