@@ -219,8 +219,7 @@ ZEND_GET_MODULE(sockets)
219
219
#endif
220
220
221
221
#ifndef HAVE_INET_NTOP
222
- /* inet_ntop should be used instead of inet_ntoa */
223
- int inet_ntoa_lock = 0 ;
222
+ #error inet_ntop unsupported on this platform
224
223
#endif
225
224
226
225
static bool php_open_listen_sock (php_socket * sock , int port , int backlog ) /* {{{ */
@@ -964,14 +963,7 @@ PHP_FUNCTION(socket_getsockname)
964
963
#endif
965
964
case AF_INET :
966
965
sin = (struct sockaddr_in * ) sa ;
967
- #ifdef HAVE_INET_NTOP
968
966
addr_string = inet_ntop (AF_INET , & sin -> sin_addr , addrbuf , sizeof (addrbuf ));
969
- #else
970
- while (inet_ntoa_lock == 1 );
971
- inet_ntoa_lock = 1 ;
972
- addr_string = inet_ntoa (sin -> sin_addr );
973
- inet_ntoa_lock = 0 ;
974
- #endif
975
967
ZEND_TRY_ASSIGN_REF_STRING (addr , addr_string );
976
968
977
969
if (port != NULL ) {
@@ -1043,14 +1035,7 @@ PHP_FUNCTION(socket_getpeername)
1043
1035
#endif
1044
1036
case AF_INET :
1045
1037
sin = (struct sockaddr_in * ) sa ;
1046
- #ifdef HAVE_INET_NTOP
1047
1038
addr_string = inet_ntop (AF_INET , & sin -> sin_addr , addrbuf , sizeof (addrbuf ));
1048
- #else
1049
- while (inet_ntoa_lock == 1 );
1050
- inet_ntoa_lock = 1 ;
1051
- addr_string = inet_ntoa (sin -> sin_addr );
1052
- inet_ntoa_lock = 0 ;
1053
- #endif
1054
1039
ZEND_TRY_ASSIGN_REF_STRING (arg2 , addr_string );
1055
1040
1056
1041
if (arg3 != NULL ) {
@@ -1383,9 +1368,7 @@ PHP_FUNCTION(socket_recvfrom)
1383
1368
#if HAVE_IPV6
1384
1369
struct sockaddr_in6 sin6 ;
1385
1370
#endif
1386
- #ifdef HAVE_INET_NTOP
1387
1371
char addrbuf [INET6_ADDRSTRLEN ];
1388
- #endif
1389
1372
socklen_t slen ;
1390
1373
int retval ;
1391
1374
zend_long arg3 , arg4 ;
@@ -1447,11 +1430,7 @@ PHP_FUNCTION(socket_recvfrom)
1447
1430
ZSTR_LEN (recv_buf ) = retval ;
1448
1431
ZSTR_VAL (recv_buf )[ZSTR_LEN (recv_buf )] = '\0' ;
1449
1432
1450
- #ifdef HAVE_INET_NTOP
1451
1433
address = inet_ntop (AF_INET , & sin .sin_addr , addrbuf , sizeof (addrbuf ));
1452
- #else
1453
- address = inet_ntoa (sin .sin_addr );
1454
- #endif
1455
1434
1456
1435
ZEND_TRY_ASSIGN_REF_NEW_STR (arg2 , recv_buf );
1457
1436
ZEND_TRY_ASSIGN_REF_STRING (arg5 , address ? address : "0.0.0.0" );
0 commit comments