changed strtotimeval signature as per #211

This commit is contained in:
Xiao Bao Clark 2015-01-28 17:17:02 +11:00
parent 62eaa889cc
commit bdbc823f7e

View File

@ -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;