diff options
author | Vsevolod Novikov <novikov@doroga.tv> | 2011-01-29 20:12:10 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2011-04-25 19:47:16 +0200 |
commit | ca015f1a45c68aa1d641678cfc13ce0df0c58fe0 (patch) | |
tree | 7e74d24a9eec1aeb541c84359257326b5f938ff4 /lib/easy.c | |
parent | 722f286f801e456c790cec0ea10306220d4969e2 (diff) |
asynch resolvers: unified
Introducing an internal API for handling of different async resolver
backends.
Diffstat (limited to 'lib/easy.c')
-rw-r--r-- | lib/easy.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/lib/easy.c b/lib/easy.c index 05d8ded9d..9ce80d086 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -269,12 +269,10 @@ CURLcode curl_global_init(long flags) idna_init(); #endif -#ifdef CARES_HAVE_ARES_LIBRARY_INIT - if(ares_library_init(ARES_LIB_INIT_ALL)) { - DEBUGF(fprintf(stderr, "Error: ares_library_init failed\n")); + if( Curl_resolver_global_init() != CURLE_OK ) { + DEBUGF(fprintf(stderr, "Error: resolver_global_init failed\n")); return CURLE_FAILED_INIT; } -#endif #if defined(USE_LIBSSH2) && defined(HAVE_LIBSSH2_INIT) if(libssh2_init(0)) { @@ -340,9 +338,7 @@ void curl_global_cleanup(void) if(init_flags & CURL_GLOBAL_SSL) Curl_ssl_cleanup(); -#ifdef CARES_HAVE_ARES_LIBRARY_CLEANUP - ares_library_cleanup(); -#endif + Curl_resolver_global_cleanup(); if(init_flags & CURL_GLOBAL_WIN32) win32_cleanup(); @@ -676,12 +672,9 @@ CURL *curl_easy_duphandle(CURL *incurl) outcurl->change.referer_alloc = TRUE; } -#ifdef USE_ARES - /* If we use ares, we clone the ares channel for the new handle */ - if(ARES_SUCCESS != ares_dup(&outcurl->state.areschannel, - data->state.areschannel)) - goto fail; -#endif + /* Clone the resolver handle, if present, for the new handle */ + if( Curl_resolver_duphandle(&outcurl->state.resolver, data->state.resolver) != CURLE_OK ) + goto fail; Curl_convert_setup(outcurl); |