Pulled in changes for Csocket

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@668 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
prozacx
2006-02-23 05:54:29 +00:00
parent e805057e34
commit acb9012540
3 changed files with 103 additions and 25 deletions
+6 -1
View File
@@ -45,7 +45,8 @@ int GetAddrInfo( const CS_STRING & sHostname, Csock *pSock, CSSockAddr & csSockA
struct addrinfo *res = NULL;
struct addrinfo hints;
memset( (struct addrinfo *)&hints, '\0', sizeof( hints ) );
hints.ai_family = PF_UNSPEC;
hints.ai_family = csSockAddr.GetAFRequire();
hints.ai_socktype = SOCK_STREAM;
hints.ai_protocol = IPPROTO_TCP;
int iRet = getaddrinfo( sHostname.c_str(), NULL, &hints, &res );
@@ -58,6 +59,10 @@ int GetAddrInfo( const CS_STRING & sHostname, Csock *pSock, CSSockAddr & csSockA
{
if( ( pRes->ai_socktype != SOCK_STREAM ) || ( pRes->ai_protocol != IPPROTO_TCP ) )
continue;
if( ( csSockAddr.GetAFRequire() != CSSockAddr::RAF_ANY ) && ( pRes->ai_family != csSockAddr.GetAFRequire() ) )
continue; // they requested a special type, so be certain we woop past anything unwanted
if( pRes->ai_family == AF_INET )
{
if( pSock )