parent
8cb2d5f48a
commit
469f53686a
@ -173,21 +173,14 @@ static void free_config_fields(struct OperationConfig *config)
|
||||
Curl_safefree(config->preproxy);
|
||||
Curl_safefree(config->proxy_service_name);
|
||||
Curl_safefree(config->service_name);
|
||||
|
||||
Curl_safefree(config->ftp_account);
|
||||
Curl_safefree(config->ftp_alternative_to_user);
|
||||
|
||||
Curl_safefree(config->aws_sigv4);
|
||||
Curl_safefree(config->proto_str);
|
||||
Curl_safefree(config->proto_redir_str);
|
||||
#ifdef USE_ECH
|
||||
Curl_safefree(config->ech);
|
||||
config->ech = NULL;
|
||||
Curl_safefree(config->ech_config);
|
||||
config->ech_config = NULL;
|
||||
Curl_safefree(config->ech_public);
|
||||
config->ech_public = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
void config_free(struct OperationConfig *config)
|
||||
|
||||
@ -306,12 +306,9 @@ struct OperationConfig {
|
||||
bool rm_partial; /* on error, remove partially written output
|
||||
files */
|
||||
bool skip_existing;
|
||||
#ifdef USE_ECH
|
||||
char *ech; /* Config set by --ech keywords */
|
||||
char *ech_config; /* Config set by "--ech esl:" option */
|
||||
char *ech_public; /* Config set by "--ech pn:" option */
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
struct GlobalConfig {
|
||||
|
||||
@ -1917,13 +1917,10 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
|
||||
err = PARAM_ENGINES_REQUESTED;
|
||||
}
|
||||
break;
|
||||
#ifndef USE_ECH
|
||||
case C_ECH: /* --ech, not implemented by default */
|
||||
err = PARAM_LIBCURL_DOESNT_SUPPORT;
|
||||
break;
|
||||
#else
|
||||
case C_ECH: /* --ech */
|
||||
if(strlen(nextarg) > 4 && strncasecompare("pn:", nextarg, 3)) {
|
||||
if(!feature_ech)
|
||||
err = PARAM_LIBCURL_DOESNT_SUPPORT;
|
||||
else if(strlen(nextarg) > 4 && strncasecompare("pn:", nextarg, 3)) {
|
||||
/* a public_name */
|
||||
err = getstr(&config->ech_public, nextarg, DENY_BLANK);
|
||||
}
|
||||
@ -1967,7 +1964,6 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
|
||||
err = getstr(&config->ech, nextarg, DENY_BLANK);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case C_CAPATH: /* --capath */
|
||||
err = getstr(&config->capath, nextarg, DENY_BLANK);
|
||||
break;
|
||||
|
||||
@ -83,6 +83,7 @@ bool feature_spnego = FALSE;
|
||||
bool feature_ssl = FALSE;
|
||||
bool feature_tls_srp = FALSE;
|
||||
bool feature_zstd = FALSE;
|
||||
bool feature_ech = FALSE;
|
||||
|
||||
static struct feature_name_presentp {
|
||||
const char *feature_name;
|
||||
@ -95,6 +96,7 @@ static struct feature_name_presentp {
|
||||
{"brotli", &feature_brotli, CURL_VERSION_BROTLI},
|
||||
{"CharConv", NULL, CURL_VERSION_CONV},
|
||||
{"Debug", NULL, CURL_VERSION_DEBUG},
|
||||
{"ECH", &feature_ech, 0},
|
||||
{"gsasl", NULL, CURL_VERSION_GSASL},
|
||||
{"GSS-API", NULL, CURL_VERSION_GSSAPI},
|
||||
{"HSTS", &feature_hsts, CURL_VERSION_HSTS},
|
||||
|
||||
@ -61,6 +61,7 @@ extern bool feature_spnego;
|
||||
extern bool feature_ssl;
|
||||
extern bool feature_tls_srp;
|
||||
extern bool feature_zstd;
|
||||
extern bool feature_ech;
|
||||
|
||||
CURLcode get_libcurl_info(void);
|
||||
const char *proto_token(const char *proto);
|
||||
|
||||
@ -1734,15 +1734,15 @@ static CURLcode config2setopts(struct GlobalConfig *global,
|
||||
if(config->hsts)
|
||||
my_setopt_str(curl, CURLOPT_HSTS, config->hsts);
|
||||
|
||||
#ifdef USE_ECH
|
||||
/* only if enabled in configure */
|
||||
if(config->ech) /* only if set (optional) */
|
||||
my_setopt_str(curl, CURLOPT_ECH, config->ech);
|
||||
if(config->ech_public) /* only if set (optional) */
|
||||
my_setopt_str(curl, CURLOPT_ECH, config->ech_public);
|
||||
if(config->ech_config) /* only if set (optional) */
|
||||
my_setopt_str(curl, CURLOPT_ECH, config->ech_config);
|
||||
#endif
|
||||
if(feature_ech) {
|
||||
/* only if enabled in libcurl */
|
||||
if(config->ech) /* only if set (optional) */
|
||||
my_setopt_str(curl, CURLOPT_ECH, config->ech);
|
||||
if(config->ech_public) /* only if set (optional) */
|
||||
my_setopt_str(curl, CURLOPT_ECH, config->ech_public);
|
||||
if(config->ech_config) /* only if set (optional) */
|
||||
my_setopt_str(curl, CURLOPT_ECH, config->ech_config);
|
||||
}
|
||||
|
||||
/* new in 8.9.0 */
|
||||
if(config->ip_tos > 0 || config->vlan_priority > 0) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user