Browse Source

Merge pull request #11260 from mayx/HPCC-19637-Port0

HPCC-19637 ListESDLBindings returns port 0 for legacy bindings

Reviewed-By: Rodrigo Pastrana <rodrigo.pastrana@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 7 năm trước cách đây
mục cha
commit
fe51bdbf65
1 tập tin đã thay đổi với 13 bổ sung1 xóa
  1. 13 1
      esp/services/esdl_svc_engine/esdl_store.cpp

+ 13 - 1
esp/services/esdl_svc_engine/esdl_store.cpp

@@ -728,7 +728,19 @@ public:
         if (!conn)
            throw MakeStringException(-1, "Unable to connect to ESDL Service definition information in dali '%s'", ESDL_DEFS_ROOT_PATH);
 
-        return createPTreeFromIPT(conn->queryRoot());
+        Owned<IPropertyTree> bindings = createPTreeFromIPT(conn->queryRoot());
+        Owned<IPropertyTreeIterator> iter = bindings->getElements("*");
+        ForEach (*iter)
+        {
+            IPropertyTree &binding = iter->query();
+            if (binding.getPropInt("@port", 0) == 0)
+            {
+                Owned<IPropertyTree> espbindingcfg = getEspBindingConfig(binding.queryProp("@espprocess"), nullptr, binding.queryProp("@espbinding"));
+                if(espbindingcfg)
+                    binding.setPropInt("@port", espbindingcfg->getPropInt("@port", 0));
+            }
+        }
+        return bindings.getLink();
     }
 
 private: