urldata: store dns cache timeout in an int

68 years ought to be enough for most.

Closes #9097
This commit is contained in:
Daniel Stenberg 2022-07-04 19:28:49 +02:00
parent 127d04aadf
commit ccc8092b05
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
2 changed files with 5 additions and 2 deletions

View File

@ -246,7 +246,10 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param)
arg = va_arg(param, long);
if(arg < -1)
return CURLE_BAD_FUNCTION_ARGUMENT;
data->set.dns_cache_timeout = arg;
else if(arg > INT_MAX)
arg = INT_MAX;
data->set.dns_cache_timeout = (int)arg;
break;
case CURLOPT_DNS_USE_GLOBAL_CACHE:
/* deprecated */

View File

@ -1743,7 +1743,7 @@ struct UserDefined {
struct ssl_config_data proxy_ssl; /* user defined SSL stuff for proxy */
#endif
struct ssl_general_config general_ssl; /* general user defined SSL stuff */
long dns_cache_timeout; /* DNS cache timeout */
int dns_cache_timeout; /* DNS cache timeout (seconds) */
long buffer_size; /* size of receive buffer to use */
unsigned int upload_buffer_size; /* size of upload buffer to use,
keep it >= CURL_MAX_WRITE_SIZE */