Skip to content

Commit

Permalink
Merge pull request #845 from pharo-project/fix-local-address-lookup
Browse files Browse the repository at this point in the history
Remove hostname lookup on network initialization
  • Loading branch information
tesonep authored Aug 28, 2024
2 parents 65d2cab + d46d367 commit 41f631a
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions extracted/plugins/SocketPlugin/src/common/SocketPluginImpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ volatile static int thisNetSession = 0;
static int one= 1;

static char localHostName[MAXHOSTNAMELEN];
static u_long localHostAddress; /* GROSS IPv4 ASSUMPTION! */

/*
* The ERROR constants are different in Windows and in Unix.
Expand Down Expand Up @@ -635,8 +634,6 @@ sqInt sqNetworkInit(sqInt resolverSemaIndex)
{
if (0 != thisNetSession)
return 0; /* already initialised */
gethostname(localHostName, MAXHOSTNAMELEN);
localHostAddress= nameToAddr(localHostName);
thisNetSession= clock() + time(0);
if (0 == thisNetSession)
thisNetSession= 1; /* 0 => uninitialised */
Expand Down Expand Up @@ -1710,7 +1707,6 @@ sqInt sqResolverLocalAddress(void) {
sqInt address;

gethostname(localHostName,MAXHOSTNAMELEN);

return nameToAddr(localHostName);

#endif
Expand Down

0 comments on commit 41f631a

Please sign in to comment.