Skip to content

Commit

Permalink
HPCC-29950 Replace ESP IP with ESP name in WsSMC.BrowseResources
Browse files Browse the repository at this point in the history
Signed-off-by: wangkx <[email protected]>
  • Loading branch information
wangkx committed Jul 17, 2023
1 parent 4fd8268 commit f6c4b32
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
5 changes: 3 additions & 2 deletions esp/scm/ws_smc.ecm
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,8 @@ ESPresponse
BrowseResourcesResponse
{
string PortalURL;
string NetAddress;
[depr_ver("1.27")] string NetAddress;
[min_ver("1.27")] string ESPApplication;
int OS;
[min_ver("1.13")] bool UseResource;
ESParray<ESPstruct HPCCResourceRepository> HPCCResourceRepositories;
Expand Down Expand Up @@ -436,7 +437,7 @@ ESPresponse [exceptions_inline] GetBuildInfoResponse
ESParray<ESPstruct NamedValue> BuildInfo;
};

ESPservice [auth_feature("DEFERRED"), noforms, version("1.26"), default_client_version("1.26"), exceptions_inline("./smc_xslt/exceptions.xslt"), use_method_name] WsSMC
ESPservice [auth_feature("DEFERRED"), noforms, version("1.27"), default_client_version("1.27"), exceptions_inline("./smc_xslt/exceptions.xslt"), use_method_name] WsSMC
{
ESPmethod Index(SMCIndexRequest, SMCIndexResponse);
ESPmethod [resp_xsl_default("/esp/xslt/index.xslt")] Activity(ActivityRequest, ActivityResponse);
Expand Down
16 changes: 11 additions & 5 deletions esp/services/ws_smc/ws_smcService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ void CWsSMCEx::init(IPropertyTree *cfg, const char *process, const char *service
throw MakeStringException(-1, "No Dali Connection Active. Please Specify a Dali to connect to in you configuration file");
}

espApplicationName.set(process);
m_BannerAction = 0;
m_EnableChatURL = false;
m_BannerSize = "4";
Expand Down Expand Up @@ -1925,11 +1926,16 @@ bool CWsSMCEx::onBrowseResources(IEspContext &context, IEspBrowseResourcesReques
double version = context.getClientVersion();

//The resource files will be downloaded from the same box of ESP (not dali)
StringBuffer ipStr;
IpAddress ipaddr = queryHostIP();
ipaddr.getIpText(ipStr);
if (ipStr.length() > 0)
resp.setNetAddress(ipStr.str());
if (version >= 1.27)
resp.setESPApplication(espApplicationName);
else
{
StringBuffer ipStr;
IpAddress ipaddr = queryHostIP();
ipaddr.getIpText(ipStr);
if (!ipStr.isEmpty())
resp.setNetAddress(ipStr.str());
}
#ifdef _WIN32
resp.setOS(MachineOsW2K);
#else
Expand Down
1 change: 1 addition & 0 deletions esp/services/ws_smc/ws_smcService.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ class CWsSMCEx : public CWsSMC
StringBuffer m_BannerColor;
StringBuffer m_BannerScroll;
StringBuffer m_PortalURL;
StringAttr espApplicationName;
int m_BannerAction;
bool m_EnableChatURL;
CriticalSection crit;
Expand Down

0 comments on commit f6c4b32

Please sign in to comment.