浏览代码

HPCC-10821 minor changes

Move WsSMCStatusServerTypeNames definition close to WsSMCStatusServerType;
Check WsSMCSSTterm before testing a WsSMCStatusServerType.
Kevin Wang 11 年之前
父节点
当前提交
9028ffab55
共有 2 个文件被更改,包括 3 次插入5 次删除
  1. 1 5
      esp/services/ws_smc/ws_smcService.cpp
  2. 2 0
      esp/services/ws_smc/ws_smcService.hpp

+ 1 - 5
esp/services/ws_smc/ws_smcService.cpp

@@ -1292,13 +1292,9 @@ bool CWsSMCEx::onActivity(IEspContext &context, IEspActivityRequest &req, IEspAc
     return true;
 }
 
-const char *WsSMCStatusServerTypeNames[] = { "ThorMaster", "RoxieServer", "HThorServer", "ECLagent" };
-
 const char *CWsSMCEx::getStatusServerTypeName(WsSMCStatusServerType type)
 {
-    if (type < sizeof(WsSMCStatusServerTypeNames)/sizeof(char *))
-        return WsSMCStatusServerTypeNames[type];
-    return NULL;
+    return (type < WsSMCSSTterm) ? WsSMCStatusServerTypeNames[type] : NULL;
 }
 
 void CWsSMCEx::readTargetClusterInfo(IEspContext &context, CConstWUClusterInfoArray& clusters, IPropertyTree* serverStatusRoot,

+ 2 - 0
esp/services/ws_smc/ws_smcService.hpp

@@ -50,6 +50,8 @@ enum WsSMCStatusServerType
     WsSMCSSTterm = 4
 };
 
+static const char *WsSMCStatusServerTypeNames[] = { "ThorMaster", "RoxieServer", "HThorServer", "ECLagent" };
+
 class CWsSMCQueue
 {
 public: