diff --git a/agents/MeshCmd-signed.exe b/agents/MeshCmd-signed.exe index 76e77e99..f4a48d56 100644 Binary files a/agents/MeshCmd-signed.exe and b/agents/MeshCmd-signed.exe differ diff --git a/agents/MeshCmd64-signed.exe b/agents/MeshCmd64-signed.exe index e1289c90..51059713 100644 Binary files a/agents/MeshCmd64-signed.exe and b/agents/MeshCmd64-signed.exe differ diff --git a/agents/MeshService-signed.exe b/agents/MeshService-signed.exe index e608eddc..556506ff 100644 Binary files a/agents/MeshService-signed.exe and b/agents/MeshService-signed.exe differ diff --git a/agents/MeshService.exe b/agents/MeshService.exe index 0fded0c2..6bcbc9ac 100644 Binary files a/agents/MeshService.exe and b/agents/MeshService.exe differ diff --git a/agents/MeshService64-signed.exe b/agents/MeshService64-signed.exe index 5cb14260..0f0cafbf 100644 Binary files a/agents/MeshService64-signed.exe and b/agents/MeshService64-signed.exe differ diff --git a/agents/MeshService64.exe b/agents/MeshService64.exe index a8ff8ad0..5c24aee4 100644 Binary files a/agents/MeshService64.exe and b/agents/MeshService64.exe differ diff --git a/agents/meshcore.js b/agents/meshcore.js index 4083ce0a..364c8305 100644 --- a/agents/meshcore.js +++ b/agents/meshcore.js @@ -423,7 +423,6 @@ function createMeshCore(agent) { // List all the drives in the root, or the root itself var results = null; try { results = fs.readDrivesSync(); } catch (e) { } // TODO: Anyway to get drive total size and free space? Could draw a progress bar. - //console.log('a', objToString(results, 0, ' ')); if (results != null) { for (var i = 0; i < results.length; ++i) { var drive = { n: results[i].name, t: 1 }; @@ -435,11 +434,13 @@ function createMeshCore(agent) { // List all the files and folders in this path if (reqpath == '') { reqpath = '/'; } var results = null, xpath = obj.path.join(reqpath, '*'); + //if (process.platform == "win32") { xpath = xpath.split('/').join('\\'); } try { results = fs.readdirSync(xpath); } catch (e) { } if (results != null) { for (var i = 0; i < results.length; ++i) { if ((results[i] != '.') && (results[i] != '..')) { var stat = null, p = obj.path.join(reqpath, results[i]); + //if (process.platform == "win32") { p = p.split('/').join('\\'); } try { stat = fs.statSync(p); } catch (e) { } // TODO: Get file size/date if ((stat != null) && (stat != undefined)) { if (stat.isDirectory() == true) { @@ -1478,47 +1479,6 @@ function createMeshCore(agent) { } }; - // Get a formated response for a given directory path - obj.getDirectoryInfo = function(reqpath) { - var response = { path: reqpath, dir: [] }; - if (((reqpath == undefined) || (reqpath == '')) && (process.platform == 'win32')) { - // List all the drives in the root, or the root itself - var results = null; - try { results = fs.readDrivesSync(); } catch (e) { sendConsoleText(e); } // TODO: Anyway to get drive total size and free space? Could draw a progress bar. - //console.log('a', objToString(results, 0, ' ')); - if (results != null) { - for (var i = 0; i < results.length; ++i) { - var drive = { n: results[i].name, t: 1 }; - if (results[i].type == 'REMOVABLE') { drive.dt = 'removable'; } // TODO: See if this is USB/CDROM or something else, we can draw icons. - response.dir.push(drive); - } - } - } else { - // List all the files and folders in this path - if (reqpath == '') { reqpath = '/'; } - var xpath = path.join(reqpath, '*'); - var results = null; - - try { results = fs.readdirSync(xpath); } catch (e) { sendConsoleText(e); } - if (results != null) { - for (var i = 0; i < results.length; ++i) { - if ((results[i] != '.') && (results[i] != '..')) { - var stat = null, p = path.join(reqpath, results[i]); - try { stat = fs.statSync(p); } catch (e) { } // TODO: Get file size/date - if ((stat != null) && (stat != undefined)) { - if (stat.isDirectory() == true) { - response.dir.push({ n: results[i], t: 2, d: stat.mtime }); - } else { - response.dir.push({ n: results[i], t: 3, s: stat.size, d: stat.mtime }); - } - } - } - } - } - } - return response; - } - // Process KVM control channel data obj.kvmCtrlData = function(channel, cmd) { if (cmd.length > 0 && cmd.charCodeAt(0) != 123) { diff --git a/mpsserver.js b/mpsserver.js index 6b9ec5e5..b6fe898a 100644 --- a/mpsserver.js +++ b/mpsserver.js @@ -630,7 +630,11 @@ module.exports.CreateMpsServer = function (parent, db, args, certificates) { // This function writes data to this CIRA channel cirachannel.write = function (data) { if (cirachannel.state == 0) return false; - if (cirachannel.state == 1 || cirachannel.sendcredits == 0 || cirachannel.sendBuffer != undefined) { if (cirachannel.sendBuffer == undefined) { cirachannel.sendBuffer = data; } else { cirachannel.sendBuffer += data; } return; } + if (cirachannel.state == 1 || cirachannel.sendcredits == 0 || cirachannel.sendBuffer != undefined) { + // Channel is connected, but we are out of credits. Add the data to the outbound buffer. + if (cirachannel.sendBuffer == undefined) { cirachannel.sendBuffer = data; } else { cirachannel.sendBuffer += data; } + return true; + } // Compute how much data we can send if (data.length <= cirachannel.sendcredits) { // Send the entire message diff --git a/package.json b/package.json index ecabb958..e00adf98 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "meshcentral", - "version": "0.1.8-y", + "version": "0.1.9-b", "keywords": [ "Remote Management", "Intel AMT",