aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2010-10-14 22:17:32 +0200
committerDaniel Stenberg <daniel@haxx.se>2010-10-14 22:18:55 +0200
commit11e131c9f987ca5649a6ac05885dd5701bd46424 (patch)
tree5bf204f84ba86e046334cce9939ef1e515c2fbbc
parent4b0c411ce6656baaa7e7eaa9e5e4c5c5d399df2d (diff)
options: check for features for some options
Some options, such as the automatic decompression and some SSL related ones now will bail out if the underlying libcurl doesn't have support for the particular feature needed.
-rw-r--r--src/main.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 95b47ea3a..8a942de07 100644
--- a/src/main.c
+++ b/src/main.c
@@ -2116,6 +2116,8 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
break;
case 'j': /* --compressed */
+ if(toggle && !(curlinfo->features & CURL_VERSION_LIBZ))
+ return PARAM_LIBCURL_DOESNT_SUPPORT;
config->encoding = toggle;
break;
@@ -2260,6 +2262,8 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
case '$': /* more options without a short option */
switch(subletter) {
case 'a': /* --ftp-ssl */
+ if(toggle && !(curlinfo->features & CURL_VERSION_SSL))
+ return PARAM_LIBCURL_DOESNT_SUPPORT;
config->ftp_ssl = toggle;
break;
case 'b': /* --ftp-pasv */
@@ -2351,12 +2355,16 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
GetStr(&config->ftp_alternative_to_user, nextarg);
break;
case 'v': /* --ftp-ssl-reqd */
+ if(toggle && !(curlinfo->features & CURL_VERSION_SSL))
+ return PARAM_LIBCURL_DOESNT_SUPPORT;
config->ftp_ssl_reqd = toggle;
break;
case 'w': /* --no-sessionid */
config->disable_sessionid = (bool)(!toggle);
break;
case 'x': /* --ftp-ssl-control */
+ if(toggle && !(curlinfo->features & CURL_VERSION_SSL))
+ return PARAM_LIBCURL_DOESNT_SUPPORT;
config->ftp_ssl_control = toggle;
break;
case 'y': /* --ftp-ssl-ccc */