summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2018-09-06 09:16:02 +0200
committerDaniel Stenberg <daniel@haxx.se>2018-09-06 09:17:25 +0200
commit5ffbb63e4271b7df05f0bfc31d0696745f028e76 (patch)
tree54ed0ceb752b1713efdce049f39c5df23be9fda5 /src
parentabff183387ae7e4a0bb7cbdd653ff64aeb1840a7 (diff)
downloadcurl-5ffbb63e4271b7df05f0bfc31d0696745f028e76.tar.gz
curl: --doh-url added
Diffstat (limited to 'src')
-rw-r--r--src/tool_cfgable.c1
-rw-r--r--src/tool_cfgable.h1
-rw-r--r--src/tool_getparam.c4
-rw-r--r--src/tool_help.c2
-rw-r--r--src/tool_operate.c3
5 files changed, 11 insertions, 0 deletions
diff --git a/src/tool_cfgable.c b/src/tool_cfgable.c
index 81e16c1c8..7d088ae0f 100644
--- a/src/tool_cfgable.c
+++ b/src/tool_cfgable.c
@@ -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);
diff --git a/src/tool_cfgable.h b/src/tool_cfgable.h
index a0363e9a7..b719fa219 100644
--- a/src/tool_cfgable.h
+++ b/src/tool_cfgable.h
@@ -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;
diff --git a/src/tool_getparam.c b/src/tool_getparam.c
index aad147148..58f3f5827 100644
--- a/src/tool_getparam.c
+++ b/src/tool_getparam.c
@@ -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;
diff --git a/src/tool_help.c b/src/tool_help.c
index b829e76ef..5b04ea203 100644
--- a/src/tool_help.c
+++ b/src/tool_help.c
@@ -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>",
diff --git a/src/tool_operate.c b/src/tool_operate.c
index 2c3f6dd4c..5a72b6a8c 100644
--- a/src/tool_operate.c
+++ b/src/tool_operate.c
@@ -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);