mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-01-11 15:03:20 -05:00
Added cancel() support to File Search
This commit is contained in:
parent
9bebca7b97
commit
7386a3f8c2
@ -2221,6 +2221,8 @@ function createMeshCore(agent) {
|
||||
case 'findfile': {
|
||||
// Search for files
|
||||
var r = require('file-search').find(cmd.path, cmd.filter);
|
||||
if (!r.cancel) { r.cancel = function cancel() { this.child.kill(); }; }
|
||||
this._search = r;
|
||||
r.socket = this;
|
||||
r.socket.reqid = cmd.reqid; // Search request id. This is used to send responses and cancel the request.
|
||||
r.socket.path = cmd.path; // Search path
|
||||
@ -2229,9 +2231,11 @@ function createMeshCore(agent) {
|
||||
break;
|
||||
}
|
||||
case 'cancelfindfile': {
|
||||
// TODO: Cancel a search for files
|
||||
// cmd.reqid <-- Cancel this reqid
|
||||
sendConsoleText('cancelfindfile: ' + cmd.reqid);
|
||||
if (this._search)
|
||||
{
|
||||
this._search.cancel();
|
||||
this._search = null;
|
||||
}
|
||||
}
|
||||
case 'download': {
|
||||
// Download a file
|
||||
|
Loading…
Reference in New Issue
Block a user