From 3fd82a600c388663865eebb6b4566dbdcc1f462b Mon Sep 17 00:00:00 2001 From: psychon Date: Thu, 10 Dec 2009 21:29:47 +0000 Subject: [PATCH] Always use blocking DNS for resolving bind hosts This fixes a bug where ZNC failed to bind to domain names if they weren't mentioned in /etc/hosts. Thanks to alturiak for finding and reporting this. Thanks to Imaginos for finding a quick workaround. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1673 726aef4b-f618-498e-8847-2d620e286838 --- Csocket.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Csocket.cpp b/Csocket.cpp index 6aa741ac..dc05a6ba 100644 --- a/Csocket.cpp +++ b/Csocket.cpp @@ -857,7 +857,9 @@ bool Csock::Listen( u_short iPort, int iMaxConns, const CS_STRING & sBindHost, u m_sBindHost = sBindHost; if ( !sBindHost.empty() ) { - if( GetAddrInfo( sBindHost, m_address ) != 0 ) + // forcing this to block regardless of resolver overloading, because listen is not currently setup to + // to handle nonblocking operations. This is used to resolve local ip's for binding anyways and should be instant + if( ::GetAddrInfo( sBindHost, this, m_address ) != 0 ) return( false ); }