mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-07 09:17:29 +00:00
get rid of inet_addr usage
This commit is contained in:
1 parent
9ba3c367f7
commit
e5b6f43ec7
2 files changed
+8
No files matched your search
@@ -688,8 +688,12 @@ int fcgi_listen(const char *path, int backlog)
|
||||
if (!*host || !strncmp(host, "*", sizeof("*")-1)) {
|
||||
sa.sa_inet.sin_addr.s_addr = htonl(INADDR_ANY);
|
||||
} else {
|
||||
#ifdef HAVE_INET_PTON
|
||||
if (!inet_pton(AF_INET, host, &sa.sa_inet.sin_addr)) {
|
||||
#else
|
||||
sa.sa_inet.sin_addr.s_addr = inet_addr(host);
|
||||
if (sa.sa_inet.sin_addr.s_addr == INADDR_NONE) {
|
||||
#endif
|
||||
struct hostent *hep;
|
||||
|
||||
if(strlen(host) > MAXFQDNLEN) {
|
||||
|
||||
@@ -2672,8 +2672,12 @@ int LSAPI_ParseSockAddr( const char * pBind, struct sockaddr * pAddr )
|
||||
((struct sockaddr_in *)pAddr)->sin_addr.s_addr = htonl( INADDR_LOOPBACK );
|
||||
else
|
||||
{
|
||||
#ifdef HAVE_INET_PTON
|
||||
if (!inet_pton(AF_INET, p, &((struct sockaddr_in *)pAddr)->sin_addr))
|
||||
#else
|
||||
((struct sockaddr_in *)pAddr)->sin_addr.s_addr = inet_addr( p );
|
||||
if ( ((struct sockaddr_in *)pAddr)->sin_addr.s_addr == INADDR_BROADCAST)
|
||||
#endif
|
||||
{
|
||||
doAddrInfo = 1;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user