1
0
mirror of https://github.com/moparisthebest/curl synced 2025-02-28 09:21:50 -05:00

curl: don't set FTP options for FTP-disabled builds

... since libcurl has started to be totally unaware of options for
disabled protocols they now return error.

Bug: c9c5304dd4 (commitcomment-33533937)

Reported-by: Marcel Raad
Closes #3886
This commit is contained in:
Daniel Stenberg 2019-05-15 08:42:57 +02:00
parent fe20826b58
commit f506ce099f
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -1018,7 +1018,9 @@ static CURLcode operate_do(struct GlobalConfig *global,
} /* (built_in_protos & CURLPROTO_HTTP) */
#ifndef CURL_DISABLE_FTP
my_setopt_str(curl, CURLOPT_FTPPORT, config->ftpport);
#endif
my_setopt(curl, CURLOPT_LOW_SPEED_LIMIT,
config->low_speed_limit);
my_setopt(curl, CURLOPT_LOW_SPEED_TIME, config->low_speed_time);
@ -1373,12 +1375,13 @@ static CURLcode operate_do(struct GlobalConfig *global,
my_setopt(curl, CURLOPT_IGNORE_CONTENT_LENGTH, config->ignorecl?1L:0L);
#ifndef CURL_DISABLE_FTP
/* curl 7.14.2 */
my_setopt(curl, CURLOPT_FTP_SKIP_PASV_IP, config->ftp_skip_ip?1L:0L);
/* curl 7.15.1 */
my_setopt(curl, CURLOPT_FTP_FILEMETHOD, (long)config->ftp_filemethod);
#endif
/* curl 7.15.2 */
if(config->localport) {
my_setopt(curl, CURLOPT_LOCALPORT, config->localport);