mirror of
https://github.com/znc/znc.git
synced 2026-08-06 00:43:19 +02:00
WTF? Two csocket updates on one day?
Fix the wrong error message for gethostbyname() and in case of a real error use the proper error message. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@865 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
+20
-6
@@ -28,7 +28,7 @@
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
* $Revision: 1.59 $
|
||||
* $Revision: 1.60 $
|
||||
*/
|
||||
|
||||
#include "Csocket.h"
|
||||
@@ -87,18 +87,32 @@ static int __GetHostByName( const CS_STRING & sHostName, struct in_addr *paddr,
|
||||
break;
|
||||
|
||||
if ( iReturn != TRY_AGAIN )
|
||||
{
|
||||
CS_DEBUG( "gethostyname_r: " << hstrerror( h_errno ) );
|
||||
break;
|
||||
}
|
||||
|
||||
PERROR( "gethostbyname_r" );
|
||||
}
|
||||
if ( ( !hent ) && ( iReturn == 0 ) )
|
||||
iReturn = HOST_NOT_FOUND;
|
||||
#else
|
||||
hent = gethostbyname( sHostName.c_str() );
|
||||
PERROR( "gethostbyname" );
|
||||
for( u_int a = 0; a < iNumRetries; a++ )
|
||||
{
|
||||
iReturn = HOST_NOT_FOUND;
|
||||
hent = gethostbyname( sHostName.c_str() );
|
||||
|
||||
if ( hent )
|
||||
iReturn = 0;
|
||||
if ( hent )
|
||||
{
|
||||
iReturn = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
if( h_errno != TRY_AGAIN )
|
||||
{
|
||||
CS_DEBUG( "gethostyname: " << hstrerror( h_errno ) );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* __linux__ */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user