diff options
author | Daniel Stenberg <daniel@haxx.se> | 2019-05-09 10:58:04 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2019-05-11 11:38:58 +0200 |
commit | 12d655d4561cfee0103c57e791c59a263863e561 (patch) | |
tree | cc271bc27c77189fe5c52cea5e412af0f915b7ad /lib/hostip.c | |
parent | edf2f6a6f60debd80ae3cef7a68fb84faaef7c5d (diff) | |
download | curl-12d655d4561cfee0103c57e791c59a263863e561.tar.gz |
doh: disable DOH for the cases it doesn't work
Due to limitations in Curl_resolver_wait_resolv(), it doesn't work for
DOH resolves. This fix disables DOH for those.
Limitation added to KNOWN_BUGS.
Fixes #3850
Closes #3857
Diffstat (limited to 'lib/hostip.c')
-rw-r--r-- | lib/hostip.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/hostip.c b/lib/hostip.c index 365d3c661..ed00ad5b9 100644 --- a/lib/hostip.c +++ b/lib/hostip.c @@ -482,6 +482,7 @@ Curl_cache_addr(struct Curl_easy *data, int Curl_resolv(struct connectdata *conn, const char *hostname, int port, + bool allowDOH, struct Curl_dns_entry **entry) { struct Curl_dns_entry *dns = NULL; @@ -527,7 +528,7 @@ int Curl_resolv(struct connectdata *conn, return CURLRESOLV_ERROR; } - if(data->set.doh) { + if(allowDOH && data->set.doh) { addr = Curl_doh(conn, hostname, port, &respwait); } else { @@ -653,7 +654,7 @@ int Curl_resolv_timeout(struct connectdata *conn, if(!timeout) /* USE_ALARM_TIMEOUT defined, but no timeout actually requested */ - return Curl_resolv(conn, hostname, port, entry); + return Curl_resolv(conn, hostname, port, TRUE, entry); if(timeout < 1000) { /* The alarm() function only provides integer second resolution, so if @@ -715,7 +716,7 @@ int Curl_resolv_timeout(struct connectdata *conn, /* Perform the actual name resolution. This might be interrupted by an * alarm if it takes too long. */ - rc = Curl_resolv(conn, hostname, port, entry); + rc = Curl_resolv(conn, hostname, port, TRUE, entry); #ifdef USE_ALARM_TIMEOUT clean_up: |