convert CURLFTPAUTH_* to long constants

This commit is contained in:
Viktor Szakats 2025-07-01 17:15:45 +02:00
parent 36af5cceb1
commit 686d3fed2f
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
3 changed files with 7 additions and 6 deletions

View file

@ -61,7 +61,7 @@ int main(void)
curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/file.txt");
curl_easy_setopt(curl, CURLOPT_USE_SSL, CURLUSESSL_TRY);
/* funny server, ask for SSL before TLS */
curl_easy_setopt(curl, CURLOPT_FTPSSLAUTH, (long)CURLFTPAUTH_SSL);
curl_easy_setopt(curl, CURLOPT_FTPSSLAUTH, CURLFTPAUTH_SSL);
res = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}

View file

@ -987,11 +987,12 @@ typedef enum {
} curl_ftpccc;
/* parameter for the CURLOPT_FTPSSLAUTH option */
#define CURLFTPAUTH_DEFAULT 0L /* let libcurl decide */
#define CURLFTPAUTH_SSL 1L /* use "AUTH SSL" */
#define CURLFTPAUTH_TLS 2L /* use "AUTH TLS" */
typedef enum {
CURLFTPAUTH_DEFAULT, /* let libcurl decide */
CURLFTPAUTH_SSL, /* use "AUTH SSL" */
CURLFTPAUTH_TLS, /* use "AUTH TLS" */
CURLFTPAUTH_LAST /* not an option, never use */
CURLFTPAUTH_LAST = 3 /* not an option, never use */
} curl_ftpauth;
/* parameter for the CURLOPT_FTP_CREATE_MISSING_DIRS option */

View file

@ -900,7 +900,7 @@ static CURLcode setopt_long(struct Curl_easy *data, CURLoption option,
*/
if((arg < CURLFTPAUTH_DEFAULT) || (arg >= CURLFTPAUTH_LAST))
return CURLE_BAD_FUNCTION_ARGUMENT;
data->set.ftpsslauth = (unsigned char)(curl_ftpauth)arg;
data->set.ftpsslauth = (unsigned char)arg;
break;
case CURLOPT_ACCEPTTIMEOUT_MS:
/*