@@ -1347,7 +1347,6 @@ int wolfIO_TcpConnect(SOCKET_T* sockfd, const char* ip, word16 port, int to_sec)
13471347 char strPort [6 ];
13481348#else
13491349 /* use gethostbyname */
1350- #if !defined(WOLFSSL_USE_POPEN_HOST )
13511350#if defined(__GLIBC__ ) && (__GLIBC__ >= 2 ) && defined(__USE_MISC ) && \
13521351 !defined(SINGLE_THREADED )
13531352 HOSTENT entry_buf , * entry = NULL ;
@@ -1356,7 +1355,6 @@ int wolfIO_TcpConnect(SOCKET_T* sockfd, const char* ip, word16 port, int to_sec)
13561355#else
13571356 HOSTENT * entry ;
13581357#endif
1359- #endif /* !WOLFSSL_USE_POPEN_HOST */
13601358#ifdef WOLFSSL_IPV6
13611359 SOCKADDR_IN6 * sin ;
13621360#else
@@ -1405,67 +1403,6 @@ int wolfIO_TcpConnect(SOCKET_T* sockfd, const char* ip, word16 port, int to_sec)
14051403 sockaddr_len = answer -> ai_addrlen ;
14061404 XMEMCPY (& addr , answer -> ai_addr , (size_t )sockaddr_len );
14071405 freeaddrinfo (answer );
1408- #elif defined(WOLFSSL_USE_POPEN_HOST ) && !defined(WOLFSSL_IPV6 )
1409- {
1410- char host_ipaddr [4 ] = { 127 , 0 , 0 , 1 };
1411- int found = 1 ;
1412-
1413- if ((XSTRNCMP (ip , "localhost" , 10 ) != 0 ) &&
1414- (XSTRNCMP (ip , "127.0.0.1" , 10 ) != 0 )) {
1415- FILE * fp ;
1416- char host_out [100 ];
1417- char cmd [100 ];
1418-
1419- XSTRNCPY (cmd , "host " , 6 );
1420- XSTRNCAT (cmd , ip , 99 - XSTRLEN (cmd ));
1421- found = 0 ;
1422- fp = popen (cmd , "r" );
1423- if (fp != NULL ) {
1424- while (fgets (host_out , sizeof (host_out ), fp ) != NULL ) {
1425- int i ;
1426- int j = 0 ;
1427- for (j = 0 ; host_out [j ] != '\0' ; j ++ ) {
1428- if ((host_out [j ] >= '0' ) && (host_out [j ] <= '9' )) {
1429- break ;
1430- }
1431- }
1432- found = (host_out [j ] >= '0' ) && (host_out [j ] <= '9' );
1433- if (!found ) {
1434- continue ;
1435- }
1436-
1437- for (i = 0 ; i < 4 ; i ++ ) {
1438- host_ipaddr [i ] = atoi (host_out + j );
1439- while ((host_out [j ] >= '0' ) && (host_out [j ] <= '9' )) {
1440- j ++ ;
1441- }
1442- if (host_out [j ] == '.' ) {
1443- j ++ ;
1444- found &= (i != 3 );
1445- }
1446- else {
1447- found &= (i == 3 );
1448- break ;
1449- }
1450- }
1451- if (found ) {
1452- break ;
1453- }
1454- }
1455- pclose (fp );
1456- }
1457- }
1458- if (found ) {
1459- sin = (SOCKADDR_IN * )& addr ;
1460- sin -> sin_family = AF_INET ;
1461- sin -> sin_port = XHTONS (port );
1462- XMEMCPY (& sin -> sin_addr .s_addr , host_ipaddr , sizeof (host_ipaddr ));
1463- }
1464- else {
1465- WOLFSSL_MSG ("no addr info for responder" );
1466- return WOLFSSL_FATAL_ERROR ;
1467- }
1468- }
14691406#else
14701407#if defined(__GLIBC__ ) && (__GLIBC__ >= 2 ) && defined(__USE_MISC ) && \
14711408 !defined(SINGLE_THREADED )
0 commit comments