vtls: remove the Curl_cft_ssl_proxy object if CURL_DISABLE_PROXY

Closes #12459
This commit is contained in:
MAntoniak 2023-12-05 23:49:12 +01:00 committed by Daniel Stenberg
parent 7309b9cbbf
commit 4dbc7acc19
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
3 changed files with 18 additions and 1 deletions

View File

@ -157,8 +157,10 @@ static struct Curl_cftype *cf_types[] = {
#endif
#ifdef USE_SSL
&Curl_cft_ssl,
#ifndef CURL_DISABLE_PROXY
&Curl_cft_ssl_proxy,
#endif
#endif
#if !defined(CURL_DISABLE_PROXY)
#if !defined(CURL_DISABLE_HTTP)
&Curl_cft_h1_proxy,

View File

@ -1846,6 +1846,8 @@ struct Curl_cftype Curl_cft_ssl = {
ssl_cf_query,
};
#ifndef CURL_DISABLE_PROXY
struct Curl_cftype Curl_cft_ssl_proxy = {
"SSL-PROXY",
CF_TYPE_SSL,
@ -1864,6 +1866,8 @@ struct Curl_cftype Curl_cft_ssl_proxy = {
Curl_cf_def_query,
};
#endif /* !CURL_DISABLE_PROXY */
static CURLcode cf_ssl_create(struct Curl_cfilter **pcf,
struct Curl_easy *data,
struct connectdata *conn)
@ -1971,8 +1975,12 @@ bool Curl_ssl_supports(struct Curl_easy *data, int option)
static struct Curl_cfilter *get_ssl_filter(struct Curl_cfilter *cf)
{
for(; cf; cf = cf->next) {
if(cf->cft == &Curl_cft_ssl || cf->cft == &Curl_cft_ssl_proxy)
if(cf->cft == &Curl_cft_ssl)
return cf;
#ifndef CURL_DISABLE_PROXY
if(cf->cft == &Curl_cft_ssl_proxy)
return cf;
#endif
}
return NULL;
}
@ -2018,7 +2026,12 @@ CURLcode Curl_ssl_cfilter_remove(struct Curl_easy *data,
bool Curl_ssl_cf_is_proxy(struct Curl_cfilter *cf)
{
#ifndef CURL_DISABLE_PROXY
return (cf->cft == &Curl_cft_ssl_proxy);
#else
(void)cf;
return FALSE;
#endif
}
struct ssl_config_data *

View File

@ -228,7 +228,9 @@ struct ssl_primary_config *
Curl_ssl_cf_get_primary_config(struct Curl_cfilter *cf);
extern struct Curl_cftype Curl_cft_ssl;
#ifndef CURL_DISABLE_PROXY
extern struct Curl_cftype Curl_cft_ssl_proxy;
#endif
#else /* if not USE_SSL */