Explorar o código

HPCC-22120 Ensure resolved IP for SparkThor setting

When '.' is used as the IP setting, WsTopology should return the
resolved IP for the setting.

Signed-off-by: wangkx <kevin.wang@lexisnexis.com>
wangkx %!s(int64=5) %!d(string=hai) anos
pai
achega
16a988528c
Modificáronse 1 ficheiros con 10 adicións e 1 borrados
  1. 10 1
      esp/smc/SMCLib/TpWrapper.cpp

+ 10 - 1
esp/smc/SMCLib/TpWrapper.cpp

@@ -1818,7 +1818,16 @@ void CTpWrapper::appendTpMachine(double clientVersion, IConstEnvironment* constE
 
     Owned<IEspTpMachine> machine = createTpMachine();
     machine->setName(name.str());
-    machine->setNetaddress(networkAddress.str());
+
+    if (networkAddress.length() > 0)
+    {
+        IpAddress ipAddr;
+        ipAddr.ipset(networkAddress.str());
+
+        StringBuffer networkAddressStr;
+        ipAddr.getIpText(networkAddressStr);
+        machine->setNetaddress(networkAddressStr);
+    }
     machine->setPort(instanceInfo.getPort());
     machine->setOS(machineInfo->getOS());
     machine->setDirectory(directory.str());