curl: --doh-url added

This commit is contained in:
Daniel Stenberg 2018-09-06 09:16:02 +02:00
parent abff183387
commit 5ffbb63e42
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
7 changed files with 21 additions and 1 deletions

View file

@ -102,6 +102,7 @@ static void free_config_fields(struct OperationConfig *config)
config->url_get = NULL;
config->url_out = NULL;
Curl_safefree(config->doh_url);
Curl_safefree(config->cipher_list);
Curl_safefree(config->proxy_cipher_list);
Curl_safefree(config->cert);

View file

@ -115,6 +115,7 @@ struct OperationConfig {
struct getout *url_get; /* point to the node to fill in URL */
struct getout *url_out; /* point to the node to fill in outfile */
struct getout *url_ul; /* point to the node to fill in upload */
char *doh_url;
char *cipher_list;
char *proxy_cipher_list;
char *cipher13_list;

View file

@ -80,6 +80,7 @@ static const struct LongShort aliases[]= {
{"*b", "egd-file", ARG_STRING},
{"*B", "oauth2-bearer", ARG_STRING},
{"*c", "connect-timeout", ARG_STRING},
{"*C", "doh-url" , ARG_STRING},
{"*d", "ciphers", ARG_STRING},
{"*D", "dns-interface", ARG_STRING},
{"*e", "disable-epsv", ARG_BOOL},
@ -619,6 +620,9 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
if(err)
return err;
break;
case 'C': /* doh-url */
GetStr(&config->doh_url, nextarg);
break;
case 'd': /* ciphers */
GetStr(&config->cipher_list, nextarg);
break;

View file

@ -118,6 +118,8 @@ static const struct helptxt helptext[] = {
"IPv6 address to use for DNS requests"},
{" --dns-servers <addresses>",
"DNS server addrs to use"},
{" --doh-url <URL>",
"Resolve host names over DOH"},
{"-D, --dump-header <filename>",
"Write the received headers to <filename>"},
{" --egd-file <file>",

View file

@ -1262,6 +1262,9 @@ static CURLcode operate_do(struct GlobalConfig *global,
my_setopt(curl, CURLOPT_CONNECTTIMEOUT_MS,
(long)(config->connecttimeout * 1000));
if(config->doh_url)
my_setopt_str(curl, CURLOPT_DOH_URL, config->doh_url);
if(config->cipher_list)
my_setopt_str(curl, CURLOPT_SSL_CIPHER_LIST, config->cipher_list);