@@ -499,11 +499,11 @@ php_socket_t php_network_bind_socket_to_local_addr(const char *host, unsigned po
499
499
}
500
500
/* }}} */
501
501
502
- PHPAPI int php_network_parse_network_address_with_port (const char * addr , zend_long addrlen , struct sockaddr * sa , socklen_t * sl )
502
+ PHPAPI zend_result php_network_parse_network_address_with_port (const char * addr , size_t addrlen , struct sockaddr * sa , socklen_t * sl )
503
503
{
504
504
char * colon ;
505
505
char * tmp ;
506
- int ret = FAILURE ;
506
+ zend_result ret = FAILURE ;
507
507
short port ;
508
508
struct sockaddr_in * in4 = (struct sockaddr_in * )sa ;
509
509
struct sockaddr * * psal ;
@@ -843,7 +843,7 @@ php_socket_t php_network_connect_socket_to_host(const char *host, unsigned short
843
843
struct sockaddr_in6 in6 ;
844
844
#endif
845
845
} local_address = {0 };
846
- int local_address_len = 0 ;
846
+ size_t local_address_len = 0 ;
847
847
848
848
if (sa -> sa_family == AF_INET ) {
849
849
if (inet_pton (AF_INET , bindto , & local_address .in4 .sin_addr ) == 1 ) {
@@ -974,7 +974,7 @@ PHPAPI void php_any_addr(int family, php_sockaddr_storage *addr, unsigned short
974
974
/* {{{ php_sockaddr_size
975
975
* Returns the size of struct sockaddr_xx for the family
976
976
*/
977
- PHPAPI int php_sockaddr_size (php_sockaddr_storage * addr )
977
+ PHPAPI socklen_t php_sockaddr_size (php_sockaddr_storage * addr )
978
978
{
979
979
switch (((struct sockaddr * )addr )-> sa_family ) {
980
980
case AF_INET :
@@ -1099,9 +1099,9 @@ PHPAPI php_stream *_php_stream_sock_open_host(const char *host, unsigned short p
1099
1099
return stream ;
1100
1100
}
1101
1101
1102
- PHPAPI int php_set_sock_blocking (php_socket_t socketd , int block )
1102
+ PHPAPI zend_result php_set_sock_blocking (php_socket_t socketd , bool block )
1103
1103
{
1104
- int ret = SUCCESS ;
1104
+ zend_result ret = SUCCESS ;
1105
1105
1106
1106
#ifdef PHP_WIN32
1107
1107
u_long flags ;
@@ -1253,7 +1253,7 @@ static struct hostent * gethostname_re (const char *host,struct hostent *hostbuf
1253
1253
* tmphstbuf = (char * )realloc (* tmphstbuf ,* hstbuflen );
1254
1254
}
1255
1255
1256
- if (res != SUCCESS ) {
1256
+ if (res != 0 ) {
1257
1257
return NULL ;
1258
1258
}
1259
1259
@@ -1295,7 +1295,7 @@ static struct hostent * gethostname_re (const char *host,struct hostent *hostbuf
1295
1295
}
1296
1296
memset ((void * )(* tmphstbuf ),0 ,* hstbuflen );
1297
1297
1298
- if (SUCCESS != gethostbyname_r (host ,hostbuf ,(struct hostent_data * )* tmphstbuf )) {
1298
+ if (0 != gethostbyname_r (host ,hostbuf ,(struct hostent_data * )* tmphstbuf )) {
1299
1299
return NULL ;
1300
1300
}
1301
1301
0 commit comments