diff options
author | Daniel Stenberg <daniel@haxx.se> | 2007-09-28 21:48:28 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2007-09-28 21:48:28 +0000 |
commit | 2c105af910df6a607989143fb14a7ae67b17a9c9 (patch) | |
tree | 04649eca1cc3b16fcb3c390fb6c0a65f88864021 /lib | |
parent | bb667c8ac642611ee2481fc3099f1789b3ca6982 (diff) |
Adapted the c-ares code to the API change c-ares 1.5.0 brings in the
notifier callback(s).
Diffstat (limited to 'lib')
-rw-r--r-- | lib/hostasyn.c | 12 | ||||
-rw-r--r-- | lib/hostip.h | 16 |
2 files changed, 27 insertions, 1 deletions
diff --git a/lib/hostasyn.c b/lib/hostasyn.c index 792ef9ac0..b7fff8939 100644 --- a/lib/hostasyn.c +++ b/lib/hostasyn.c @@ -151,19 +151,31 @@ static CURLcode addrinfo_callback(void *arg, /* "struct connectdata *" */ CURLcode Curl_addrinfo4_callback(void *arg, /* "struct connectdata *" */ int status, +#ifdef HAVE_CARES_CALLBACK_TIMEOUTS + int timeouts, +#endif struct hostent *hostent) { +#ifdef HAVE_CARES_CALLBACK_TIMEOUTS + (void)timeouts; /* ignored */ +#endif return addrinfo_callback(arg, status, hostent); } #ifdef CURLRES_IPV6 CURLcode Curl_addrinfo6_callback(void *arg, /* "struct connectdata *" */ int status, +#ifdef HAVE_CARES_CALLBACK_TIMEOUTS + int timeouts, +#endif struct addrinfo *ai) { /* NOTE: for CURLRES_ARES, the 'ai' argument is really a * 'struct hostent' pointer. */ +#ifdef HAVE_CARES_CALLBACK_TIMEOUTS + (void)timeouts; /* ignored */ +#endif return addrinfo_callback(arg, status, ai); } #endif diff --git a/lib/hostip.h b/lib/hostip.h index 199c666bd..53093c169 100644 --- a/lib/hostip.h +++ b/lib/hostip.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2006, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -36,6 +36,10 @@ */ #ifdef USE_ARES +#include <ares_version.h> +#endif + +#ifdef USE_ARES #define CURLRES_ASYNCH #define CURLRES_ARES #endif @@ -85,6 +89,10 @@ #ifdef CURLRES_ARES #define CURL_ASYNC_SUCCESS ARES_SUCCESS +#if ARES_VERSION >= 0x010500 +/* c-ares 1.5.0 or later, the callback proto is modified */ +#define HAVE_CARES_CALLBACK_TIMEOUTS 1 +#endif #else #define CURL_ASYNC_SUCCESS CURLE_OK #define ares_cancel(x) do {} while(0) @@ -216,11 +224,17 @@ int curl_dogetnameinfo(GETNAMEINFO_QUAL_ARG1 GETNAMEINFO_TYPE_ARG1 sa, resolve, ipv4 */ CURLcode Curl_addrinfo4_callback(void *arg, int status, +#ifdef HAVE_CARES_CALLBACK_TIMEOUTS + int timeouts, +#endif struct hostent *hostent); /* This is the callback function that is used when we build with asynch resolve, ipv6 */ CURLcode Curl_addrinfo6_callback(void *arg, int status, +#ifdef HAVE_CARES_CALLBACK_TIMEOUTS + int timeouts, +#endif struct addrinfo *ai); |