Drop legacy ifdef for ares support and code cleanup. * src/AsyncNameResolver.cc * src/AsyncNameResolver.h
@@ -1,3 +1,9 @@
+2010-02-02 Tatsuhiro Tsujikawa <[email protected]>
+
+ Drop legacy ifdef for ares support and code cleanup.
+ * src/AsyncNameResolver.cc
+ * src/AsyncNameResolver.h
2010-02-02 Tatsuhiro Tsujikawa <[email protected]>
Call ares_library_init and ares_library_cleanup if they are
@@ -33,10 +33,11 @@
*/
/* copyright --> */
#include "AsyncNameResolver.h"
-#include "util.h"
-#include "A2STR.h"
#include <cstring>
+#include "A2STR.h"
namespace aria2 {
#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);
if(status != ARES_SUCCESS) {
-#ifdef HAVE_LIBCARES
resolverPtr->error = ares_strerror(status);
-#else
- resolverPtr->error = ares_strerror(status, 0);
-#endif // HAVE_LIBCARES
resolverPtr->status = AsyncNameResolver::STATUS_ERROR;
return;
}
@@ -36,18 +36,14 @@
#define _D_ASYNC_NAME_RESOLVER_H_
#include "common.h"
-#include "SharedHandle.h"
-#include "a2netcompat.h"
#include <string>
#include <deque>
-#ifdef __cplusplus
-extern "C" {
-#endif
#include <ares.h>
-} /* end of extern "C" */
+#include "SharedHandle.h"
+#include "a2netcompat.h"