diff options
author | Daniel Stenberg <daniel@haxx.se> | 2010-09-21 16:41:14 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2010-09-21 16:41:14 +0200 |
commit | 19f45eaa799a77d5c67cbefe3342f27774e2e6f8 (patch) | |
tree | b6657dfd4f0365c9c2ebc0742b39a38296575738 /lib | |
parent | 70a025f3df42aac0e68e54dddd5b337e149c8d22 (diff) |
duphandle: use ares_dup()
curl_easy_duphandle() was not properly duping the ares channel. The
ares_dup() function was introduced in c-ares 1.6.0 so by starting to use
this function we also raise the bar and require c-ares >= 1.6.0
(released Dec 9, 2008) for such builds.
Reported by: Ning Dong
Bug: http://curl.haxx.se/mail/lib-2010-08/0318.html
Diffstat (limited to 'lib')
-rw-r--r-- | lib/easy.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/easy.c b/lib/easy.c index bebeeb17f..1f839fe24 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -700,8 +700,9 @@ CURL *curl_easy_duphandle(CURL *incurl) } #ifdef USE_ARES - /* If we use ares, we setup a new ares channel for the new handle */ - if(ARES_SUCCESS != ares_init(&outcurl->state.areschannel)) + /* If we use ares, we clone the ares channel for the new handle */ + if(ARES_SUCCESS != ares_dup(&outcurl->state.areschannel, + data->state.areschannel)) break; #endif |