]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
urldata: reduce size of four ftp related members
authorDaniel Stenberg <daniel@haxx.se>
Mon, 4 Jul 2022 22:11:35 +0000 (00:11 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 5 Jul 2022 08:18:48 +0000 (10:18 +0200)
ftp_filemethod, ftpsslauth and ftp_ccc are now uchars

accepttimeout is now unsigned int - almost 50 days ought to be enough
for this value.

Closes #9106

lib/setopt.c
lib/urldata.h

index 1bb44bd91929e0d4842748fd0b3994bc492d85e4..d5e3b50c82320ef42bf656858f2badcb68618e56 100644 (file)
@@ -1481,10 +1481,10 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param)
     /*
      * The maximum time for curl to wait for FTP server connect
      */
-    arg = va_arg(param, long);
-    if(arg < 0)
-      return CURLE_BAD_FUNCTION_ARGUMENT;
-    data->set.accepttimeout = arg;
+    uarg = va_arg(param, unsigned long);
+    if(uarg >= UINT_MAX)
+      uarg = UINT_MAX;
+    data->set.accepttimeout = (unsigned int)uarg;
     break;
 #endif
 
index b3c6f16130665fd2ebe209000f7cb9248a06fc72..826d3190b39956ef57b23e30e9f930a4010d6407 100644 (file)
@@ -1753,10 +1753,10 @@ struct UserDefined {
                           file 0 - whatever, 1 - v2, 2 - v6 */
   curl_off_t max_filesize; /* Maximum file size to download */
 #ifndef CURL_DISABLE_FTP
-  curl_ftpfile ftp_filemethod; /* how to get to a file when FTP is used  */
-  curl_ftpauth ftpsslauth; /* what AUTH XXX to be attempted */
-  curl_ftpccc ftp_ccc;   /* FTP CCC options */
-  long accepttimeout;   /* in milliseconds, 0 means no timeout */
+  unsigned char ftp_filemethod; /* how to get to a file: curl_ftpfile  */
+  unsigned char ftpsslauth; /* what AUTH XXX to try: curl_ftpauth */
+  unsigned char ftp_ccc;   /* FTP CCC options: curl_ftpccc */
+  unsigned int accepttimeout;   /* in milliseconds, 0 means no timeout */
 #endif
   /* Desppie the name ftp_create_missing_dirs is for FTP(S) and SFTP
      1 - create directories that don't exist