mirror of https://github.com/aria2/aria2
2010-02-02 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Drop legacy ifdef for ares support and code cleanup. * src/AsyncNameResolver.cc * src/AsyncNameResolver.hpull/1/head
parent
abcc014675
commit
76aad1de2b
|
@ -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>
|
||||
|
||||
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>
|
||||
#ifdef __cplusplus
|
||||
} /* end of extern "C" */
|
||||
#endif
|
||||
|
||||
#include "SharedHandle.h"
|
||||
#include "a2netcompat.h"
|
||||
|
||||
namespace aria2 {
|
||||
|
||||
|
|
Loading…
Reference in New Issue