summaryrefslogtreecommitdiff
path: root/libs/libcurl/src/setopt.c
diff options
context:
space:
mode:
authordartraiden <wowemuh@gmail.com>2025-02-13 23:08:12 +0300
committerdartraiden <wowemuh@gmail.com>2025-02-17 17:19:53 +0300
commitad2538d4732ca78575c6038d9d905382cf11e9b1 (patch)
tree9d3bade18910927d2eb0177076096330aac1c5ed /libs/libcurl/src/setopt.c
parentb7133232e0c3cc419fd2ad78c205213be894f0fb (diff)
libcurl: update to 8.12.1
Diffstat (limited to 'libs/libcurl/src/setopt.c')
-rw-r--r--libs/libcurl/src/setopt.c38
1 files changed, 16 insertions, 22 deletions
diff --git a/libs/libcurl/src/setopt.c b/libs/libcurl/src/setopt.c
index 13a4754da3..3c1bb803f4 100644
--- a/libs/libcurl/src/setopt.c
+++ b/libs/libcurl/src/setopt.c
@@ -601,8 +601,8 @@ static CURLcode setopt_long(struct Curl_easy *data, CURLoption option,
switch(arg) {
case CURL_HTTP_VERSION_NONE:
#ifdef USE_HTTP2
- /* TODO: this seems an undesirable quirk to force a behaviour on
- * lower implementations that they should recognize independently? */
+ /* This seems an undesirable quirk to force a behaviour on lower
+ * implementations that they should recognize independently? */
arg = CURL_HTTP_VERSION_2TLS;
#endif
/* accepted */
@@ -644,13 +644,7 @@ static CURLcode setopt_long(struct Curl_easy *data, CURLoption option,
break;
case CURLOPT_HTTP09_ALLOWED:
-#ifdef USE_HYPER
- /* Hyper does not support HTTP/0.9 */
- if(enabled)
- return CURLE_BAD_FUNCTION_ARGUMENT;
-#else
data->set.http09_allowed = enabled;
-#endif
break;
#endif /* ! CURL_DISABLE_HTTP */
@@ -923,6 +917,7 @@ static CURLcode setopt_long(struct Curl_easy *data, CURLoption option,
break;
#endif
+#ifdef HAVE_GSSAPI
case CURLOPT_GSSAPI_DELEGATION:
/*
* GSS-API credential delegation bitmask
@@ -930,6 +925,7 @@ static CURLcode setopt_long(struct Curl_easy *data, CURLoption option,
data->set.gssapi_delegation = (unsigned char)uarg&
(CURLGSSAPI_DELEGATION_POLICY_FLAG|CURLGSSAPI_DELEGATION_FLAG);
break;
+#endif
case CURLOPT_SSL_VERIFYPEER:
/*
* Enable peer SSL verifying.
@@ -991,7 +987,7 @@ static CURLcode setopt_long(struct Curl_easy *data, CURLoption option,
/*
* Enable TLS false start.
*/
- if(!Curl_ssl_false_start(data))
+ if(!Curl_ssl_false_start())
return CURLE_NOT_BUILT_IN;
data->set.ssl.falsestart = enabled;
@@ -1110,7 +1106,8 @@ static CURLcode setopt_long(struct Curl_easy *data, CURLoption option,
*/
if(arg > 2)
return CURLE_BAD_FUNCTION_ARGUMENT;
- data->set.connect_only = (unsigned char)arg;
+ data->set.connect_only = !!arg;
+ data->set.connect_only_ws = (arg == 2);
break;
case CURLOPT_SSL_SESSIONID_CACHE:
@@ -1587,10 +1584,6 @@ static CURLcode setopt_pointers(struct Curl_easy *data, CURLoption option,
if(data->share->hsts == data->hsts)
data->hsts = NULL;
#endif
-#ifdef USE_SSL
- if(data->share->sslsession == data->state.session)
- data->state.session = NULL;
-#endif
#ifdef USE_LIBPSL
if(data->psl == &data->share->psl)
data->psl = data->multi ? &data->multi->psl : NULL;
@@ -1631,12 +1624,6 @@ static CURLcode setopt_pointers(struct Curl_easy *data, CURLoption option,
data->hsts = data->share->hsts;
}
#endif
-#ifdef USE_SSL
- if(data->share->sslsession) {
- data->set.general_ssl.max_ssl_sessions = data->share->max_ssl_sessions;
- data->state.session = data->share->sslsession;
- }
-#endif
#ifdef USE_LIBPSL
if(data->share->specifier & (1 << CURL_LOCK_DATA_PSL))
data->psl = &data->share->psl;
@@ -2111,7 +2098,6 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option,
* The URL to fetch.
*/
if(data->state.url_alloc) {
- /* the already set URL is allocated, free it first! */
Curl_safefree(data->state.url);
data->state.url_alloc = FALSE;
}
@@ -2199,6 +2185,13 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option,
/*
* pass CURLU to set URL
*/
+ if(data->state.url_alloc) {
+ Curl_safefree(data->state.url);
+ data->state.url_alloc = FALSE;
+ }
+ else
+ data->state.url = NULL;
+ Curl_safefree(data->set.str[STRING_SET_URL]);
data->set.uh = (CURLU *)ptr;
break;
case CURLOPT_SSLCERT:
@@ -2424,6 +2417,7 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option,
*/
return Curl_setstropt(&data->set.str[STRING_SSH_PRIVATE_KEY], ptr);
+#if defined(USE_LIBSSH2) || defined(USE_LIBSSH)
case CURLOPT_SSH_HOST_PUBLIC_KEY_MD5:
/*
* Option to allow for the MD5 of the host public key to be checked
@@ -2436,7 +2430,7 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option,
* Store the filename to read known hosts from.
*/
return Curl_setstropt(&data->set.str[STRING_SSH_KNOWNHOSTS], ptr);
-
+#endif
case CURLOPT_SSH_KEYDATA:
/*
* Custom client data to pass to the SSH keyfunc callback