]> granicus.if.org Git - curl/commitdiff
curl: don't set FTP options for FTP-disabled builds
authorDaniel Stenberg <daniel@haxx.se>
Wed, 15 May 2019 06:42:57 +0000 (08:42 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 16 May 2019 06:11:37 +0000 (08:11 +0200)
... since libcurl has started to be totally unaware of options for
disabled protocols they now return error.

Bug: https://github.com/curl/curl/commit/c9c5304dd4747cbe75d2f24be85920d572fcb5b8#commitcomment-33533937

Reported-by: Marcel Raad
Closes #3886

src/tool_operate.c

index e1ceabe7a4fdf837d9ff9789a4df0b4b3c61dc53..6ed06e0f49c4445e5c156829a2c453618d494114 100644 (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);