urldata: reduce size of four ftp related members

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
This commit is contained in:
Daniel Stenberg 2022-07-05 00:11:35 +02:00
parent dcb7d4f904
commit 1b3d59acf9
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
2 changed files with 8 additions and 8 deletions

View 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

View 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