aria2/m4/libares.m4

34 lines
874 B
Plaintext
Raw Normal View History

2006-08-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> To add asynchronous DNS support(libares): * src/AbstractCommand.h (setNameResolverCheck): New function. (disableNameResolverCheck): New function (resolveHostname): New function. * src/AbstractCommand.cc (setNameResolverCheck): New function. (disableNameResolverCheck): New function (resolveHostname): New function. * src/FtpInitiateConnectionCommand.h (nameResolver): New function. * src/FtpInitiateConnectionCommand.cc (Util.h): Included. (FtpInitiateConnectionCommand): Call disableReadCheckSocket, disableWriteCheckSocket. (~FtpInitiateConnectionCommand): Call disableNameResolverCheck. (executeInternal): Added async DNS support. * src/HttpInitiateConnectionCommand.h (nameResolver): New function. * src/HttpInitiateConnectionCommand.cc (DlRetryEx.h): Included. (HttpInitiateConnectionCommand): Call disableReadCheckSocket, disableWriteCheckSocket. (~HttpInitiateConnectionCommand): Call disableNameResolverCheck. (executeInternal): Added async DNS support. * src/NameResolver.h: New class. Note: #include <ares.h> is surrounded by extern "C" declaration. * src/NameResolver.cc: New class. * src/Util.h: (isNumberAndDotsNotation): New function * src/Util.cc (isNumberAndDotsNotation): New function. * src/DownloadEngine.h (NameResolver.h): Included. (NameResolverEntry): New class. (NameResolverEntries): New type definition. (addNameResolverCheck): New function. (deleteNameResolverCheck): New function. * src/DownloadEngine.cc (run): Initialize cp with 0. (SetDescriptor::operator()): Added for NameResolverEntry. (AccumulateActiveUuid::operator()): Added for NameResolverEntry. (waitData): Check nameResolver entries. (updateFdSet): Update fds in nameResolver entries. (addNameResolverCheck): New function. (deleteNameResolverCheck): new function. * src/PeerInteractionCommand.cc (executeInternal): Fixed wrong socket handling. * src/main.cc (main): Fixed the initial value of PREF_LOWEST_SPEED_LIMIT option to 0. * src/Util.cc (fileChecksum): Removed the call to ctx.digestReset().
2006-08-11 12:29:55 +00:00
AC_DEFUN([AM_PATH_LIBARES],
[
AC_ARG_WITH([libares-prefix],
[ --with-libares-prefix=PREFIX Prefix where libares installed (optional)],
[libares_prefix=$withval],
[libares_prefix=""])
if test "x$libares_prefix" = "x"; then
libares_prefix="/usr/local"
fi
libares_prefix_lib=$libares_prefix/lib
libares_prefix_include=$libares_prefix/include
LIBS_save=$LIBS
CPPFLAGS_save=$CPPFLAGS
LIBS="-L$libares_prefix_lib $LIBS"
CPPFLAGS="-I$libares_prefix_include $CPPFLAGS"
AC_CHECK_LIB([ares], [ares_init], [have_libares=yes])
if test "x$have_libares" = "xyes"; then
AC_DEFINE([HAVE_LIBARES], [1], [Define to 1 if you have libares.])
LIBARES_LIBS="-L$libares_prefix_lib -lares"
LIBARES_CPPFLAGS="-I$libares_prefix_include"
AC_SUBST(LIBARES_LIBS)
AC_SUBST(LIBARES_CPPFLAGS)
fi
LIBS=$LIBS_save
CPPFLAGS=$CPPFLAGS_save
])