mirror of
https://github.com/znc/znc.git
synced 2026-08-06 08:52:57 +02:00
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:
+6
-1
@@ -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 )
|
||||
|
||||
Reference in New Issue
Block a user