aboutsummaryrefslogtreecommitdiff
path: root/lib/url.c
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2017-09-30 01:20:56 +0200
committerDan Fandrich <dan@coneharvesters.com>2017-09-30 02:10:54 +0200
commitdf7839b68c7a3e78c469efc28157ad0df228f32f (patch)
treed431a119c78af52b3d4d61256a0540da56ede975 /lib/url.c
parenta352e21c0bb7a2ae0d2737408198d331037c37c7 (diff)
Set and use more necessary options when some protocols are disabled
When curl and libcurl are built with some protocols disabled, they stop setting and receiving some options that don't make sense with those protocols. In particular, when HTTP is disabled many options aren't set that are used only by HTTP. However, some options that appear to be HTTP-only are actually used by other protocols as well (some despite having HTTP in the name) and should be set, but weren't. This change now causes some of these options to be set and used for more (or for all) protocols. In particular, this fixes tests 646 through 649 in an HTTP-disabled build, which use the MIME API in the mail protocols.
Diffstat (limited to 'lib/url.c')
-rw-r--r--lib/url.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/lib/url.c b/lib/url.c
index 9ad503dbd..df12cbf6d 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -1152,6 +1152,7 @@ CURLcode Curl_setopt(struct Curl_easy *data, CURLoption option,
data->set.httpreq = HTTPREQ_POST_FORM;
data->set.opt_no_body = FALSE; /* this is implied */
break;
+#endif /* CURL_DISABLE_HTTP */
case CURLOPT_MIMEPOST:
/*
@@ -1194,6 +1195,7 @@ CURLcode Curl_setopt(struct Curl_easy *data, CURLoption option,
data->set.headers = va_arg(param, struct curl_slist *);
break;
+#ifndef CURL_DISABLE_HTTP
case CURLOPT_PROXYHEADER:
/*
* Set a list with proxy headers to use (or replace internals with)
@@ -1345,7 +1347,7 @@ CURLcode Curl_setopt(struct Curl_easy *data, CURLoption option,
}
break;
-#endif /* CURL_DISABLE_COOKIES */
+#endif /* !CURL_DISABLE_COOKIES */
case CURLOPT_HTTPGET:
/*
@@ -1371,6 +1373,16 @@ CURLcode Curl_setopt(struct Curl_easy *data, CURLoption option,
data->set.httpversion = arg;
break;
+ case CURLOPT_EXPECT_100_TIMEOUT_MS:
+ /*
+ * Time to wait for a response to a HTTP request containing an
+ * Expect: 100-continue header before sending the data anyway.
+ */
+ data->set.expect_100_timeout = va_arg(param, long);
+ break;
+
+#endif /* CURL_DISABLE_HTTP */
+
case CURLOPT_HTTPAUTH:
/*
* Set HTTP Authentication type BITMASK.
@@ -1422,16 +1434,6 @@ CURLcode Curl_setopt(struct Curl_easy *data, CURLoption option,
}
break;
- case CURLOPT_EXPECT_100_TIMEOUT_MS:
- /*
- * Time to wait for a response to a HTTP request containing an
- * Expect: 100-continue header before sending the data anyway.
- */
- data->set.expect_100_timeout = va_arg(param, long);
- break;
-
-#endif /* CURL_DISABLE_HTTP */
-
case CURLOPT_CUSTOMREQUEST:
/*
* Set a custom string to use as request