]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
urldata: store dns cache timeout in an int
authorDaniel Stenberg <daniel@haxx.se>
Mon, 4 Jul 2022 17:28:49 +0000 (19:28 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 4 Jul 2022 17:28:50 +0000 (19:28 +0200)
68 years ought to be enough for most.

Closes #9097

lib/setopt.c
lib/urldata.h

index dc6bc2a09cd6d93dbce8f7aa4e9a0d619b00c8c1..0ee2609ee28196892888b4ece2190e4aca0be65b 100644 (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 */
index e815e831662d3a863a7db409579dedf793da79bf..6523d74612d5949bfb935aed8ca03a5c218ff59e 100644 (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 */