Skip to content

Commit 503d3b4

Browse files
committed
get rid of inet_addr usage
1 parent 1779f68 commit 503d3b4

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

main/fastcgi.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,11 @@ int fcgi_listen(const char *path, int backlog)
688688
if (!*host || !strncmp(host, "*", sizeof("*")-1)) {
689689
sa.sa_inet.sin_addr.s_addr = htonl(INADDR_ANY);
690690
} else {
691+
#ifdef HAVE_INET_PTON
692+
inet_pton(AF_INET, host, &sa.sa_inet.sin_addr);
693+
#else
691694
sa.sa_inet.sin_addr.s_addr = inet_addr(host);
695+
#endif
692696
if (sa.sa_inet.sin_addr.s_addr == INADDR_NONE) {
693697
struct hostent *hep;
694698

sapi/litespeed/lsapilib.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2672,7 +2672,11 @@ int LSAPI_ParseSockAddr( const char * pBind, struct sockaddr * pAddr )
26722672
((struct sockaddr_in *)pAddr)->sin_addr.s_addr = htonl( INADDR_LOOPBACK );
26732673
else
26742674
{
2675+
#ifdef HAVE_INET_PTON
2676+
inet_pton(AF_INET, p, &((struct sockaddr_in *)pAddr)->sin_addr);
2677+
#else
26752678
((struct sockaddr_in *)pAddr)->sin_addr.s_addr = inet_addr( p );
2679+
#endif
26762680
if ( ((struct sockaddr_in *)pAddr)->sin_addr.s_addr == INADDR_BROADCAST)
26772681
{
26782682
doAddrInfo = 1;

0 commit comments

Comments
 (0)