mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-08 11:53:00 -04:00
changed strtotimeval signature as per #211
This commit is contained in:
parent
62eaa889cc
commit
bdbc823f7e
8
evdns.c
8
evdns.c
@ -3324,7 +3324,7 @@ strtoint(const char *const str)
|
||||
|
||||
/* Parse a number of seconds into a timeval; return -1 on error. */
|
||||
static int
|
||||
strtotimeval(const char *const str, struct timeval *out)
|
||||
evdns_strtotimeval(const char *const str, struct timeval *out)
|
||||
{
|
||||
double d;
|
||||
char *endptr;
|
||||
@ -3427,13 +3427,13 @@ evdns_base_set_option_impl(struct evdns_base *base,
|
||||
base->global_search_state->ndots = ndots;
|
||||
} else if (str_matches_option(option, "timeout:")) {
|
||||
struct timeval tv;
|
||||
if (strtotimeval(val, &tv) == -1) return -1;
|
||||
if (evdns_strtotimeval(val, &tv) == -1) return -1;
|
||||
if (!(flags & DNS_OPTION_MISC)) return 0;
|
||||
log(EVDNS_LOG_DEBUG, "Setting timeout to %s", val);
|
||||
memcpy(&base->global_timeout, &tv, sizeof(struct timeval));
|
||||
} else if (str_matches_option(option, "getaddrinfo-allow-skew:")) {
|
||||
struct timeval tv;
|
||||
if (strtotimeval(val, &tv) == -1) return -1;
|
||||
if (evdns_strtotimeval(val, &tv) == -1) return -1;
|
||||
if (!(flags & DNS_OPTION_MISC)) return 0;
|
||||
log(EVDNS_LOG_DEBUG, "Setting getaddrinfo-allow-skew to %s",
|
||||
val);
|
||||
@ -3475,7 +3475,7 @@ evdns_base_set_option_impl(struct evdns_base *base,
|
||||
base->global_outgoing_addrlen = len;
|
||||
} else if (str_matches_option(option, "initial-probe-timeout:")) {
|
||||
struct timeval tv;
|
||||
if (strtotimeval(val, &tv) == -1) return -1;
|
||||
if (evdns_strtotimeval(val, &tv) == -1) return -1;
|
||||
if (tv.tv_sec > 3600)
|
||||
tv.tv_sec = 3600;
|
||||
if (!(flags & DNS_OPTION_MISC)) return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user