浏览代码

Merge pull request #8827 from wangkx/h15768

HPCC-15768 Attach the archive to ZAP using IP/Name

Reviewed-By: Russ Whitehead <william.whitehead@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 9 年之前
父节点
当前提交
7420cb0590
共有 1 个文件被更改,包括 14 次插入3 次删除
  1. 14 3
      esp/services/ws_workunits/ws_workunitsService.cpp

+ 14 - 3
esp/services/ws_workunits/ws_workunitsService.cpp

@@ -4385,19 +4385,30 @@ void CWsWorkunitsEx::createZAPECLQueryArchiveFiles(Owned<IConstWorkUnit>& cwu, c
     ForEach(*iter)
     {
         IConstWUAssociatedFile & cur = iter->query();
-        SCMStringBuffer ssb;
+        SCMStringBuffer ssb, ip;
         cur.getDescription(ssb);
         if (!strieq(ssb.str(), "archive"))
             continue;
 
         cur.getName(ssb);
-        if (!ssb.length())
+        cur.getIp(ip);
+        if (!ssb.length() || !ip.length())
             continue;
 
         StringBuffer fileName, archiveContents;
         try
         {
-            archiveContents.loadFile(ssb.str());
+            SocketEndpoint ep(ip.str());
+            RemoteFilename rfn;
+            rfn.setRemotePath(ssb.str());
+            rfn.setIp(ep);
+            Owned<IFile> rFile = createIFile(rfn);
+            if (!rFile)
+            {
+                DBGLOG("Cannot open %s on %s", ssb.str(), ip.str());
+                continue;
+            }
+            archiveContents.loadFile(rFile);
         }
         catch (IException *e)
         {