mirror of
https://github.com/moparisthebest/curl
synced 2024-08-13 17:03:50 -04:00
duphandle: make sure CURLOPT_RESOLVE is duplicated fine too
Verified in test 1502 now Fixes #2485 Closes #2486 Reported-by: Ernst Sjöstrand
This commit is contained in:
parent
462d8378ea
commit
2b126cd708
@ -892,6 +892,9 @@ static CURLcode dupset(struct Curl_easy *dst, struct Curl_easy *src)
|
|||||||
/* Duplicate mime data. */
|
/* Duplicate mime data. */
|
||||||
result = Curl_mime_duppart(&dst->set.mimepost, &src->set.mimepost);
|
result = Curl_mime_duppart(&dst->set.mimepost, &src->set.mimepost);
|
||||||
|
|
||||||
|
if(src->set.resolve)
|
||||||
|
dst->change.resolve = dst->set.resolve;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
* Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
*
|
*
|
||||||
* This software is licensed as described in the file COPYING, which
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* you should have received as part of this distribution. The terms
|
||||||
@ -40,6 +40,7 @@
|
|||||||
int test(char *URL)
|
int test(char *URL)
|
||||||
{
|
{
|
||||||
CURL *easy = NULL;
|
CURL *easy = NULL;
|
||||||
|
CURL *dup;
|
||||||
CURLM *multi = NULL;
|
CURLM *multi = NULL;
|
||||||
int still_running;
|
int still_running;
|
||||||
int res = 0;
|
int res = 0;
|
||||||
@ -72,6 +73,15 @@ int test(char *URL)
|
|||||||
easy_setopt(easy, CURLOPT_HEADER, 1L);
|
easy_setopt(easy, CURLOPT_HEADER, 1L);
|
||||||
easy_setopt(easy, CURLOPT_RESOLVE, dns_cache_list);
|
easy_setopt(easy, CURLOPT_RESOLVE, dns_cache_list);
|
||||||
|
|
||||||
|
dup = curl_easy_duphandle(easy);
|
||||||
|
if(dup) {
|
||||||
|
curl_easy_cleanup(easy);
|
||||||
|
easy = dup;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return CURLE_OUT_OF_MEMORY;
|
||||||
|
}
|
||||||
|
|
||||||
multi_init(multi);
|
multi_init(multi);
|
||||||
|
|
||||||
multi_add_handle(multi, easy);
|
multi_add_handle(multi, easy);
|
||||||
|
Loading…
Reference in New Issue
Block a user