aboutsummaryrefslogtreecommitdiff
path: root/lib/easy.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2009-05-17 17:40:30 +0000
committerYang Tse <yangsita@gmail.com>2009-05-17 17:40:30 +0000
commit13db2916deef97bce46a7c25bdf05e6442359547 (patch)
tree6f6de8866ad15a6548999d378312ef3d35f12e52 /lib/easy.c
parent2d64cd55a1069ff7fc7e6d8caf5c67353f1ec55f (diff)
Take in account c-ares 1.6.1 introduces ares_library_init() and ares_library_cleanup()
Diffstat (limited to 'lib/easy.c')
-rw-r--r--lib/easy.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/easy.c b/lib/easy.c
index e85bee58c..5e4a48df1 100644
--- a/lib/easy.c
+++ b/lib/easy.c
@@ -280,6 +280,13 @@ CURLcode curl_global_init(long flags)
idna_init();
#endif
+#if defined(USE_ARES) && defined(ARES_VERSION) && (ARES_VERSION >= 0x010601)
+ If(ares_library_init(ARES_LIB_INIT_ALL)) {
+ DEBUGF(fprintf(stderr, "Error: ares_library_init failed\n"));
+ return CURLE_FAILED_INIT;
+ }
+#endif
+
init_flags = flags;
return CURLE_OK;
@@ -333,6 +340,10 @@ void curl_global_cleanup(void)
if(init_flags & CURL_GLOBAL_SSL)
Curl_ssl_cleanup();
+#if defined(USE_ARES) && defined(ARES_VERSION) && (ARES_VERSION >= 0x010601)
+ ares_library_cleanup();
+#endif
+
if(init_flags & CURL_GLOBAL_WIN32)
win32_cleanup();