|
|
|
@ -211,7 +211,7 @@ size_t ares_metrics_server_timeout(const struct server_state *server, |
|
|
|
|
const ares_channel_t *channel = server->channel; |
|
|
|
|
ares_server_bucket_t i; |
|
|
|
|
size_t timeout_ms = 0; |
|
|
|
|
|
|
|
|
|
size_t max_timeout_ms; |
|
|
|
|
|
|
|
|
|
for (i = 0; i < ARES_METRIC_COUNT; i++) { |
|
|
|
|
time_t ts = ares_metric_timestamp(i, now, ARES_FALSE); |
|
|
|
@ -252,10 +252,9 @@ size_t ares_metrics_server_timeout(const struct server_state *server, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* don't go above upper bounds */ |
|
|
|
|
if (channel->maxtimeout && timeout_ms > channel->maxtimeout) { |
|
|
|
|
timeout_ms = channel->maxtimeout; |
|
|
|
|
} else if (timeout_ms > MAX_TIMEOUT_MS) { |
|
|
|
|
timeout_ms = MAX_TIMEOUT_MS; |
|
|
|
|
max_timeout_ms = channel->maxtimeout?channel->maxtimeout:MAX_TIMEOUT_MS; |
|
|
|
|
if (timeout_ms > max_timeout_ms) { |
|
|
|
|
timeout_ms = max_timeout_ms; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return timeout_ms; |
|
|
|
|