summaryrefslogtreecommitdiffstats
path: root/lib/setopt.c
diff options
context:
space:
mode:
authorCurl Upstream <curl-library@cool.haxx.se>2018-10-30 16:54:00 (GMT)
committerBrad King <brad.king@kitware.com>2018-10-31 13:41:28 (GMT)
commit9835e9075037db3d23ade0ef865c562b08cf6023 (patch)
tree004b65c185c842dadac199a1ecca1de6bda566a0 /lib/setopt.c
parent18812a9c3d395b368d8f3d85394b346472c8e858 (diff)
downloadCMake-9835e9075037db3d23ade0ef865c562b08cf6023.zip
CMake-9835e9075037db3d23ade0ef865c562b08cf6023.tar.gz
CMake-9835e9075037db3d23ade0ef865c562b08cf6023.tar.bz2
curl 2018-10-30 (19667715)
Code extracted from: https://github.com/curl/curl.git at commit 196677150f711a96c38ed123e621f1d4e995b2e5 (curl-7_62_0).
Diffstat (limited to 'lib/setopt.c')
-rw-r--r--lib/setopt.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/setopt.c b/lib/setopt.c
index 5c5f4b3..22956a2 100644
--- a/lib/setopt.c
+++ b/lib/setopt.c
@@ -127,9 +127,11 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option,
data->set.dns_cache_timeout = arg;
break;
case CURLOPT_DNS_USE_GLOBAL_CACHE:
+#if 0 /* deprecated */
/* remember we want this enabled */
arg = va_arg(param, long);
data->set.global_dns_cache = (0 != arg) ? TRUE : FALSE;
+#endif
break;
case CURLOPT_SSL_CIPHER_LIST:
/* set a list of cipher we want to use in the SSL connection */
@@ -841,6 +843,8 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option,
#else
if(arg > CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE)
return CURLE_UNSUPPORTED_PROTOCOL;
+ if(arg == CURL_HTTP_VERSION_NONE)
+ arg = CURL_HTTP_VERSION_2TLS;
#endif
data->set.httpversion = arg;
break;
@@ -1936,6 +1940,22 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option,
break;
+ case CURLOPT_UPLOAD_BUFFERSIZE:
+ /*
+ * The application kindly asks for a differently sized upload buffer.
+ * Cap it to sensible.
+ */
+ arg = va_arg(param, long);
+
+ if(arg > UPLOADBUFFER_MAX)
+ arg = UPLOADBUFFER_MAX;
+ else if(arg < UPLOADBUFFER_MIN)
+ arg = UPLOADBUFFER_MIN;
+
+ data->set.upload_buffer_size = arg;
+ Curl_safefree(data->state.ulbuf); /* force a realloc next opportunity */
+ break;
+
case CURLOPT_NOSIGNAL:
/*
* The application asks not to set any signal() or alarm() handlers,
@@ -2599,6 +2619,17 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option,
data->set.disallow_username_in_url =
(0 != va_arg(param, long)) ? TRUE : FALSE;
break;
+ case CURLOPT_DOH_URL:
+ result = Curl_setstropt(&data->set.str[STRING_DOH],
+ va_arg(param, char *));
+ data->set.doh = data->set.str[STRING_DOH]?TRUE:FALSE;
+ break;
+ case CURLOPT_UPKEEP_INTERVAL_MS:
+ arg = va_arg(param, long);
+ if(arg < 0)
+ return CURLE_BAD_FUNCTION_ARGUMENT;
+ data->set.upkeep_interval_ms = arg;
+ break;
default:
/* unknown tag and its companion, just ignore: */
result = CURLE_UNKNOWN_OPTION;