2010-02-02 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

Drop legacy ifdef for ares support and code cleanup.
	* src/AsyncNameResolver.cc
	* src/AsyncNameResolver.h
pull/1/head
Tatsuhiro Tsujikawa 2010-02-02 13:49:51 +00:00
parent abcc014675
commit 76aad1de2b
3 changed files with 13 additions and 14 deletions

View File

@ -1,3 +1,9 @@
2010-02-02 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Drop legacy ifdef for ares support and code cleanup.
* src/AsyncNameResolver.cc
* src/AsyncNameResolver.h
2010-02-02 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net> 2010-02-02 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Call ares_library_init and ares_library_cleanup if they are Call ares_library_init and ares_library_cleanup if they are

View File

@ -33,10 +33,11 @@
*/ */
/* copyright --> */ /* copyright --> */
#include "AsyncNameResolver.h" #include "AsyncNameResolver.h"
#include "util.h"
#include "A2STR.h"
#include <cstring> #include <cstring>
#include "A2STR.h"
namespace aria2 { namespace aria2 {
#ifdef HAVE_LIBCARES1_5 #ifdef HAVE_LIBCARES1_5
@ -47,11 +48,7 @@ void callback(void* arg, int status, int timeouts, struct hostent* host)
{ {
AsyncNameResolver* resolverPtr = reinterpret_cast<AsyncNameResolver*>(arg); AsyncNameResolver* resolverPtr = reinterpret_cast<AsyncNameResolver*>(arg);
if(status != ARES_SUCCESS) { if(status != ARES_SUCCESS) {
#ifdef HAVE_LIBCARES
resolverPtr->error = ares_strerror(status); resolverPtr->error = ares_strerror(status);
#else
resolverPtr->error = ares_strerror(status, 0);
#endif // HAVE_LIBCARES
resolverPtr->status = AsyncNameResolver::STATUS_ERROR; resolverPtr->status = AsyncNameResolver::STATUS_ERROR;
return; return;
} }

View File

@ -36,18 +36,14 @@
#define _D_ASYNC_NAME_RESOLVER_H_ #define _D_ASYNC_NAME_RESOLVER_H_
#include "common.h" #include "common.h"
#include "SharedHandle.h"
#include "a2netcompat.h"
#include <string> #include <string>
#include <deque> #include <deque>
#ifdef __cplusplus
extern "C" {
#endif
#include <ares.h> #include <ares.h>
#ifdef __cplusplus
} /* end of extern "C" */ #include "SharedHandle.h"
#endif #include "a2netcompat.h"
namespace aria2 { namespace aria2 {