瀏覽代碼

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 5 年之前
父節點
當前提交
16a988528c
共有 1 個文件被更改,包括 10 次插入1 次删除
  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());