diff options
author | snermolaev <snermolaev@yandex-team.ru> | 2022-02-10 16:45:53 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:53 +0300 |
commit | 2015790ac9fcc04caab83fccc23ab2460310a797 (patch) | |
tree | e644e9bc3f6f688561a871793b59bf8a637e0f72 /contrib/libs/c-ares/ares_timeout.c | |
parent | c768a99151e47c3a4bb7b92c514d256abd301c4d (diff) | |
download | ydb-2015790ac9fcc04caab83fccc23ab2460310a797.tar.gz |
Restoring authorship annotation for <snermolaev@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/c-ares/ares_timeout.c')
-rw-r--r-- | contrib/libs/c-ares/ares_timeout.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/contrib/libs/c-ares/ares_timeout.c b/contrib/libs/c-ares/ares_timeout.c index 293e4af021..4a2ef2b312 100644 --- a/contrib/libs/c-ares/ares_timeout.c +++ b/contrib/libs/c-ares/ares_timeout.c @@ -23,13 +23,13 @@ #include "ares.h" #include "ares_private.h" -/* return time offset between now and (future) check, in milliseconds */ -static long timeoffset(struct timeval *now, struct timeval *check) -{ - return (check->tv_sec - now->tv_sec)*1000 + - (check->tv_usec - now->tv_usec)/1000; -} - +/* return time offset between now and (future) check, in milliseconds */ +static long timeoffset(struct timeval *now, struct timeval *check) +{ + return (check->tv_sec - now->tv_sec)*1000 + + (check->tv_usec - now->tv_usec)/1000; +} + /* WARNING: Beware that this is linear in the number of outstanding * requests! You are probably far better off just calling ares_process() * once per second, rather than calling ares_timeout() to figure out @@ -60,7 +60,7 @@ struct timeval *ares_timeout(ares_channel channel, struct timeval *maxtv, query = list_node->data; if (query->timeout.tv_sec == 0) continue; - offset = timeoffset(&now, &query->timeout); + offset = timeoffset(&now, &query->timeout); if (offset < 0) offset = 0; if (min_offset == -1 || offset < min_offset) |