From 443c523d1d6f24dc5df5d11be1a2829fb9690623 Mon Sep 17 00:00:00 2001 From: imaginos Date: Tue, 12 Jan 2010 20:46:52 +0000 Subject: [PATCH] cleanup some crosseyed code git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1710 726aef4b-f618-498e-8847-2d620e286838 --- Csocket.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Csocket.cpp b/Csocket.cpp index 82fde278..ebc7196c 100644 --- a/Csocket.cpp +++ b/Csocket.cpp @@ -28,7 +28,7 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * -* $Revision: 1.118 $ +* $Revision: 1.119 $ */ #include "Csocket.h" @@ -2143,9 +2143,10 @@ int Csock::GetAddrInfo( const CS_STRING & sHostname, CSSockAddr & csSockAddr ) } m_pCurrAddr = &csSockAddr; // flag its starting + int iFamily = AF_INET; #ifdef HAVE_IPV6 // as of ares 1.6.0 if it fails on af_inet6, it falls back to af_inet, this code was here in the previous Csocket version, just adding the comment as a reminder - int iFamily = csSockAddr.GetAFRequire() == CSSockAddr::RAF_ANY ? AF_INET6 : csSockAddr.GetAFRequire(); + iFamily = csSockAddr.GetAFRequire() == CSSockAddr::RAF_ANY ? AF_INET6 : csSockAddr.GetAFRequire(); #endif /* HAVE_IPV6 */ ares_gethostbyname( m_pARESChannel, sHostname.c_str(), iFamily, AresHostCallback, this ); } @@ -2154,7 +2155,7 @@ int Csock::GetAddrInfo( const CS_STRING & sHostname, CSSockAddr & csSockAddr ) FreeAres(); #ifdef HAVE_IPV6 #if ARES_VERSION < CREATE_ARES_VER( 1, 5, 3 ) - if( m_iARESStatus != ARES_SUCCESS && csSockAddr.GetAFRequire() == CSSockAddr::RAF_ANY && csSockAddr.GetAFRequire() == CSSockAddr::RAF_ANY ) + if( m_iARESStatus != ARES_SUCCESS && csSockAddr.GetAFRequire() == CSSockAddr::RAF_ANY ) { // this is a workaround for ares < 1.5.3 where the builtin retry on failed AF_INET6 isn't there yet CS_DEBUG( "Retry for older version of c-ares with AF_INET only" ); // this means we tried previously with AF_INET6 and failed, so force AF_INET and retry