Bläddra i källkod

HPCC-10121 Revise based on comments

Replace xpath.clear().appendf() with xpath.setf();
Add !sashaServerIp.isEmpty() check before using sashaServerIp.
Kevin Wang 11 år sedan
förälder
incheckning
8791a6dfbf
1 ändrade filer med 3 tillägg och 3 borttagningar
  1. 3 3
      esp/services/ws_workunits/ws_workunitsService.cpp

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

@@ -695,11 +695,11 @@ void CWsWorkunitsEx::init(IPropertyTree *cfg, const char *process, const char *s
     VStringBuffer xpath("Software/EspProcess[@name=\"%s\"]/EspService[@name=\"%s\"]/AWUsCacheMinutes", process, service);
     cfg->getPropInt(xpath.str(), awusCacheMinutes);
 
-    xpath.clear().appendf("Software/EspProcess[@name=\"%s\"]/EspService[@name=\"%s\"]/serverForArchivedECLWU/@netAddress", process, service);
+    xpath.setf("Software/EspProcess[@name=\"%s\"]/EspService[@name=\"%s\"]/serverForArchivedECLWU/@netAddress", process, service);
     if (cfg->hasProp(xpath.str()))
     {
         sashaServerIp.set(cfg->queryProp(xpath.str()));
-        xpath.clear().appendf("Software/EspProcess[@name=\"%s\"]/EspService[@name=\"%s\"]/serverForArchivedECLWU/@port", process, service);
+        xpath.setf("Software/EspProcess[@name=\"%s\"]/EspService[@name=\"%s\"]/serverForArchivedECLWU/@port", process, service);
         sashaServerPort = cfg->getPropInt(xpath.str(), DEFAULT_SASHA_PORT);
     }
 
@@ -990,7 +990,7 @@ bool CWsWorkunitsEx::onWUAction(IEspContext &context, IEspWUActionRequest &req,
             params->setProp("Protect", streq(sAction.str(), "protect"));
         if (*action==ActionChangeState && streq(sAction.str(), "settofailed"))
             params->setProp("State",4);
-        if (*action==ActionRestore)
+        if ((*action==ActionRestore) && !sashaServerIp.isEmpty())
         {
             params->setProp("sashaServerIP", sashaServerIp.get());
             params->setProp("sashaServerPort", sashaServerPort);