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)
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 {
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);
}
err = getstr(&config->ech, nextarg, DENY_BLANK);
}
break;
-#endif
case C_CAPATH: /* --capath */
err = getstr(&config->capath, nextarg, DENY_BLANK);
break;
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;
{"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},
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);
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) {