From b5e6518fdc890343359b5e27beeb257dc82a5ad8 Mon Sep 17 00:00:00 2001 From: psychon Date: Thu, 17 Jan 2008 22:44:12 +0000 Subject: [PATCH] Again, update to latest Csocket I wonder how often I did this kind of commit already... git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@923 726aef4b-f618-498e-8847-2d620e286838 --- Csocket.cpp | 12 +++++++++++- Csocket.h | 6 +++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Csocket.cpp b/Csocket.cpp index d9ef4552..d751e760 100644 --- a/Csocket.cpp +++ b/Csocket.cpp @@ -28,7 +28,7 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * -* $Revision: 1.62 $ +* $Revision: 1.63 $ */ #include "Csocket.h" @@ -2116,6 +2116,16 @@ int Csock::DNSLookup( EDNSLType eDNSLType ) if ( eDNSLType == DNS_VHOST ) { iRet = GetAddrInfo( m_sBindHost, this, m_bindhost ); +#ifdef HAVE_IPV6 + if( m_bindhost.GetIPv6() ) + { + SetAFRequire( CSSockAddr::RAF_INET6 ); + } + else + { + SetAFRequire( CSSockAddr::RAF_INET ); + } +#endif /* HAVE_IPV6 */ } else { diff --git a/Csocket.h b/Csocket.h index 811dee8a..ef2ba0cb 100644 --- a/Csocket.h +++ b/Csocket.h @@ -28,7 +28,7 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * -* $Revision: 1.178 $ +* $Revision: 1.179 $ */ // note to compile with win32 need to link to winsock2, using gcc its -lws2_32 @@ -1444,7 +1444,7 @@ public: if ( GetSockError() == ECONNREFUSED ) pcSock->ConnectionRefused(); else - pcSock->SockError( ECONNABORTED ); + pcSock->SockError( GetSockError() ); DelSock( a-- ); continue; @@ -1458,7 +1458,7 @@ public: if ( GetSockError() == ECONNREFUSED ) pcSock->ConnectionRefused(); else - pcSock->SockError( ECONNABORTED ); + pcSock->SockError( GetSockError() == 0 ? ECONNABORTED : GetSockError() ); DelSock( a-- ); continue;