Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions esp/services/ws_workunits/ws_workunitsQuerySets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3123,7 +3123,7 @@ class QueryCloner
StringBuffer fetchedName;
StringBuffer remoteDfs;
fetchRemoteWorkunit(NULL, context, srcAddress.str(), NULL, NULL, wuid, fetchedName, xml, dllname, dll, remoteDfs, useSSL);
deploySharedObject(*context, wuid, dllname, target, queryName, dll, queryDirectory, xml.str(), false);
deploySharedObject(*context, wuid, target, queryName, dll, queryDirectory, xml.str(), false);

SCMStringBuffer existingQueryId;
queryIdFromQuerySetWuid(destQuerySet, wuid, queryName, existingQueryId);
Expand Down Expand Up @@ -3448,7 +3448,7 @@ bool CWsWorkunitsEx::onWUQuerysetCopyQuery(IEspContext &context, IEspWUQuerySetC
wuid.set(srcInfo->getWuid());
if (targetQueryName.isEmpty())
targetQueryName.set(queryName);
deploySharedObject(context, wuid, dllname.str(), target, targetQueryName.get(), dll, queryDirectory.str(), xml.str(), false);
deploySharedObject(context, wuid, target, targetQueryName.get(), dll, queryDirectory.str(), xml.str(), false);
}
else
{
Expand Down
7 changes: 2 additions & 5 deletions esp/services/ws_workunits/ws_workunitsService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4794,7 +4794,7 @@ void writeSharedObject(const char *srcpath, const MemoryBuffer &obj, const char
throw MakeStringException(ECLWATCH_CANNOT_COPY_DLL, "Failed copying shared object %s", srcpath);
}

void deploySharedObject(IEspContext &context, StringBuffer &wuid, const char *filename, const char *cluster, const char *name, const MemoryBuffer &obj, const char *dir, const char *xml, bool protect)
void deploySharedObject(IEspContext &context, StringBuffer &wuid, const char *cluster, const char *name, const MemoryBuffer &obj, const char *dir, const char *xml, bool protect)
{
StringBuffer dllpath, dllname;

Expand Down Expand Up @@ -4866,9 +4866,6 @@ void deploySharedObject(IEspContext &context, StringBuffer &wuid, const char *fi

void CWsWorkunitsEx::deploySharedObjectReq(IEspContext &context, IEspWUDeployWorkunitRequest & req, IEspWUDeployWorkunitResponse & resp, const char *dir, const char *xml)
{
if (isEmpty(req.getFileName()))
throw MakeStringException(ECLWATCH_INVALID_INPUT, "File name required when deploying a shared object.");

const char *cluster = req.getCluster();
if (isEmpty(cluster))
throw MakeStringException(ECLWATCH_INVALID_INPUT, "Cluster name required when deploying a shared object.");
Copy link
Preview

Copilot AI Sep 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removal of filename validation could be problematic. While the parameter was unused in the deploySharedObject function, the validation ensured that callers provided a filename, which may be important for API contract consistency. Consider whether this validation should be moved elsewhere or if the filename should still be validated even if not used internally.

Suggested change
throw MakeStringException(ECLWATCH_INVALID_INPUT, "Cluster name required when deploying a shared object.");
throw MakeStringException(ECLWATCH_INVALID_INPUT, "Cluster name required when deploying a shared object.");
const char *filename = req.getName();
if (isEmpty(filename))
throw MakeStringException(ECLWATCH_INVALID_INPUT, "Filename required when deploying a shared object.");

Copilot uses AI. Check for mistakes.

Expand All @@ -4882,7 +4879,7 @@ void CWsWorkunitsEx::deploySharedObjectReq(IEspContext &context, IEspWUDeployWor
}

StringBuffer wuid;
deploySharedObject(context, wuid, req.getFileName(), cluster, req.getName(), *uncompressed, dir, xml, req.getProtect());
deploySharedObject(context, wuid, cluster, req.getName(), *uncompressed, dir, xml, req.getProtect());

WsWuInfo winfo(context, wuid.str());
winfo.getCommon(resp.updateWorkunit(), WUINFO_All);
Expand Down
2 changes: 1 addition & 1 deletion esp/services/ws_workunits/ws_workunitsService.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ class CWsWorkunitsSoapBindingEx : public CWsWorkunitsSoapBinding
StringAttr espApplicationName;
};

void deploySharedObject(IEspContext &context, StringBuffer &wuid, const char *filename, const char *cluster, const char *name, const MemoryBuffer &obj, const char *dir, const char *xml=NULL, bool protect=false);
void deploySharedObject(IEspContext &context, StringBuffer &wuid, const char *cluster, const char *name, const MemoryBuffer &obj, const char *dir, const char *xml=NULL, bool protect=false);

class CClusterQueryStateParam : public CInterface
{
Expand Down
Loading