[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnurl] 261/282: ares: store dns parameters for duphandle
From: |
gnunet |
Subject: |
[gnurl] 261/282: ares: store dns parameters for duphandle |
Date: |
Wed, 01 Apr 2020 14:32:06 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit c8f086bcc315d9dec6a7438f39c3c36dfeb27e42
Author: Ernst Sjöstrand <address@hidden>
AuthorDate: Mon Mar 2 14:51:43 2020 +0100
ares: store dns parameters for duphandle
With c-ares the dns parameters lives in ares_channel. Store them in the
curl handle and set them again in easy_duphandle.
Regression introduced in #3228 (6765e6d), shipped in curl 7.63.0.
Fixes #4893
Closes #5020
Signed-off-by: Ernst Sjöstrand <address@hidden>
---
lib/easy.c | 11 +++++++++++
lib/setopt.c | 24 ++++++++++++++++++++----
lib/urldata.h | 6 ++++++
3 files changed, 37 insertions(+), 4 deletions(-)
diff --git a/lib/easy.c b/lib/easy.c
index d1c6cedaa..d3a29f48b 100644
--- a/lib/easy.c
+++ b/lib/easy.c
@@ -883,6 +883,17 @@ struct Curl_easy *curl_easy_duphandle(struct Curl_easy
*data)
data->state.resolver))
goto fail;
+#ifdef USE_ARES
+ if(Curl_set_dns_servers(outcurl, data->set.str[STRING_DNS_SERVERS]))
+ goto fail;
+ if(Curl_set_dns_interface(outcurl, data->set.str[STRING_DNS_INTERFACE]))
+ goto fail;
+ if(Curl_set_dns_local_ip4(outcurl, data->set.str[STRING_DNS_LOCAL_IP4]))
+ goto fail;
+ if(Curl_set_dns_local_ip6(outcurl, data->set.str[STRING_DNS_LOCAL_IP6]))
+ goto fail;
+#endif /* USE_ARES */
+
Curl_convert_setup(outcurl);
Curl_initinfo(outcurl);
diff --git a/lib/setopt.c b/lib/setopt.c
index 2e494a6df..4648c872b 100644
--- a/lib/setopt.c
+++ b/lib/setopt.c
@@ -2583,16 +2583,32 @@ CURLcode Curl_vsetopt(struct Curl_easy *data,
CURLoption option, va_list param)
#endif
#ifdef USE_ARES
case CURLOPT_DNS_SERVERS:
- result = Curl_set_dns_servers(data, va_arg(param, char *));
+ result = Curl_setstropt(&data->set.str[STRING_DNS_SERVERS],
+ va_arg(param, char *));
+ if(result)
+ return result;
+ result = Curl_set_dns_servers(data, data->set.str[STRING_DNS_SERVERS]);
break;
case CURLOPT_DNS_INTERFACE:
- result = Curl_set_dns_interface(data, va_arg(param, char *));
+ result = Curl_setstropt(&data->set.str[STRING_DNS_INTERFACE],
+ va_arg(param, char *));
+ if(result)
+ return result;
+ result = Curl_set_dns_interface(data, data->set.str[STRING_DNS_INTERFACE]);
break;
case CURLOPT_DNS_LOCAL_IP4:
- result = Curl_set_dns_local_ip4(data, va_arg(param, char *));
+ result = Curl_setstropt(&data->set.str[STRING_DNS_LOCAL_IP4],
+ va_arg(param, char *));
+ if(result)
+ return result;
+ result = Curl_set_dns_local_ip4(data, data->set.str[STRING_DNS_LOCAL_IP4]);
break;
case CURLOPT_DNS_LOCAL_IP6:
- result = Curl_set_dns_local_ip6(data, va_arg(param, char *));
+ result = Curl_setstropt(&data->set.str[STRING_DNS_LOCAL_IP6],
+ va_arg(param, char *));
+ if(result)
+ return result;
+ result = Curl_set_dns_local_ip6(data, data->set.str[STRING_DNS_LOCAL_IP6]);
break;
#endif
case CURLOPT_TCP_KEEPALIVE:
diff --git a/lib/urldata.h b/lib/urldata.h
index 9e4626530..fbb8b645e 100644
--- a/lib/urldata.h
+++ b/lib/urldata.h
@@ -1577,6 +1577,11 @@ enum dupstring {
STRING_TEMP_URL, /* temp URL storage for proxy use */
+ STRING_DNS_SERVERS,
+ STRING_DNS_INTERFACE,
+ STRING_DNS_LOCAL_IP4,
+ STRING_DNS_LOCAL_IP6,
+
/* -- end of zero-terminated strings -- */
STRING_LASTZEROTERMINATED,
@@ -1585,6 +1590,7 @@ enum dupstring {
STRING_COPYPOSTFIELDS, /* if POST, set the fields' values here */
+
STRING_LAST /* not used, just an end-of-list marker */
};
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [gnurl] 234/282: cirrus-ci: disable the FreeBSD 13 builds, (continued)
- [gnurl] 234/282: cirrus-ci: disable the FreeBSD 13 builds, gnunet, 2020/04/01
- [gnurl] 243/282: Revert "pause: force-drain the transfer on unpause", gnunet, 2020/04/01
- [gnurl] 240/282: KNOWN_BUGS: configure --with-gssapi with Heimdal is ignored on macOS, gnunet, 2020/04/01
- [gnurl] 252/282: socks5: switch state properly when the resolve is done, gnunet, 2020/04/01
- [gnurl] 238/282: tests: wrap ignored test failures in braces, gnunet, 2020/04/01
- [gnurl] 255/282: seek: fix fallback for missing ftruncate on Windows, gnunet, 2020/04/01
- [gnurl] 251/282: libssh: Fix matching user-specified MD5 hex key, gnunet, 2020/04/01
- [gnurl] 256/282: tool_cb_see: set correct copyright year range, gnunet, 2020/04/01
- [gnurl] 254/282: config-win32: Windows does not have ftruncate, gnunet, 2020/04/01
- [gnurl] 262/282: runtests: fix missing use of exe_ext helper function, gnunet, 2020/04/01
- [gnurl] 261/282: ares: store dns parameters for duphandle,
gnunet <=
- [gnurl] 266/282: lib1564: reduce number of mid-wait wakeup calls, gnunet, 2020/04/01
- [gnurl] 260/282: version: make curl_version* thread-safe without using global context, gnunet, 2020/04/01
- [gnurl] 269/282: test 1560: avoid valgrind false positives, gnunet, 2020/04/01
- [gnurl] 271/282: silly web server: silent a compilation warning, gnunet, 2020/04/01
- [gnurl] 272/282: socks4: fix host resolve regression, gnunet, 2020/04/01
- [gnurl] 263/282: mime: latch last read callback status., gnunet, 2020/04/01
- [gnurl] 246/282: multi: skip EINTR check on wakeup socket if it was closed, gnunet, 2020/04/01
- [gnurl] 253/282: pause: force a connection (re-)check after unpausing, gnunet, 2020/04/01
- [gnurl] 273/282: RELEASE-NOTES: synced, gnunet, 2020/04/01
- [gnurl] 267/282: sha256: Added SecureTransport implementation, gnunet, 2020/04/01