mirror of
https://github.com/curl/curl.git
synced 2026-07-30 08:48:02 +03:00
CURLOPT: bump CURLFTP* enums to long, drop casts
This patch bumps the size of these constants from `int` to `long`, while keeping their actual values the same. It may cause incompatibilities in user code, requiring the bump of holder variables and/or adding casts: - CURLFTP_CREATE_DIR - CURLFTP_CREATE_DIR_NONE - CURLFTP_CREATE_DIR_RETRY - CURLFTPAUTH_DEFAULT - CURLFTPAUTH_SSL - CURLFTPAUTH_TLS - CURLFTPMETHOD_DEFAULT - CURLFTPMETHOD_MULTICWD - CURLFTPMETHOD_NOCWD - CURLFTPMETHOD_SINGLECWD - CURLFTPSSL_CCC_ACTIVE - CURLFTPSSL_CCC_NONE - CURLFTPSSL_CCC_PASSIVE Also: - keep existing casts within the documentation to make sure it applies to older curl versions as well. Closes #17797
This commit is contained in:
parent
5debe7cb34
commit
430f9b03fd
10 changed files with 47 additions and 44 deletions
|
|
@ -653,7 +653,7 @@ static CURLcode ftp_setopts(struct OperationConfig *config, CURL *curl)
|
|||
|
||||
/* new in curl 7.16.1 */
|
||||
if(config->ftp_ssl_ccc)
|
||||
my_setopt_enum(curl, CURLOPT_FTP_SSL_CCC, (long)config->ftp_ssl_ccc_mode);
|
||||
my_setopt_enum(curl, CURLOPT_FTP_SSL_CCC, config->ftp_ssl_ccc_mode);
|
||||
|
||||
my_setopt_str(curl, CURLOPT_FTP_ACCOUNT, config->ftp_account);
|
||||
|
||||
|
|
|
|||
|
|
@ -226,8 +226,8 @@ struct OperationConfig {
|
|||
unsigned long timecond;
|
||||
HttpReq httpreq;
|
||||
long proxyver; /* set to CURLPROXY_HTTP* define */
|
||||
int ftp_ssl_ccc_mode;
|
||||
int ftp_filemethod;
|
||||
long ftp_ssl_ccc_mode;
|
||||
long ftp_filemethod;
|
||||
enum {
|
||||
CLOBBER_DEFAULT, /* Provides compatibility with previous versions of curl,
|
||||
by using the default behavior for -o, -O, and -J.
|
||||
|
|
|
|||
|
|
@ -620,7 +620,7 @@ ParameterError add2list(struct curl_slist **list, const char *ptr)
|
|||
return PARAM_OK;
|
||||
}
|
||||
|
||||
int ftpfilemethod(struct OperationConfig *config, const char *str)
|
||||
long ftpfilemethod(struct OperationConfig *config, const char *str)
|
||||
{
|
||||
if(curl_strequal("singlecwd", str))
|
||||
return CURLFTPMETHOD_SINGLECWD;
|
||||
|
|
@ -635,7 +635,7 @@ int ftpfilemethod(struct OperationConfig *config, const char *str)
|
|||
return CURLFTPMETHOD_MULTICWD;
|
||||
}
|
||||
|
||||
int ftpcccmethod(struct OperationConfig *config, const char *str)
|
||||
long ftpcccmethod(struct OperationConfig *config, const char *str)
|
||||
{
|
||||
if(curl_strequal("passive", str))
|
||||
return CURLFTPSSL_CCC_PASSIVE;
|
||||
|
|
|
|||
|
|
@ -58,9 +58,9 @@ CURLcode get_args(struct OperationConfig *config, const size_t i);
|
|||
|
||||
ParameterError add2list(struct curl_slist **list, const char *ptr);
|
||||
|
||||
int ftpfilemethod(struct OperationConfig *config, const char *str);
|
||||
long ftpfilemethod(struct OperationConfig *config, const char *str);
|
||||
|
||||
int ftpcccmethod(struct OperationConfig *config, const char *str);
|
||||
long ftpcccmethod(struct OperationConfig *config, const char *str);
|
||||
|
||||
long delegation(struct OperationConfig *config, const char *str);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue