1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

Improved some websocket error handling.

This commit is contained in:
Ylian Saint-Hilaire 2019-01-02 18:34:50 -08:00
parent d7b60ccb07
commit 8b60090e33
10 changed files with 45 additions and 37 deletions

View file

@ -256,7 +256,7 @@ function amt_heci() {
var optional = [];
for (var i = 2; i < arguments.length; ++i) { optional.push(arguments[i]); }
var data = new Buffer(4);
var data = Buffer.alloc(4);
data.writeUInt32LE(handle, 0);
this.sendCommand(0x2D, data, function (header, fn, opt) {
@ -356,7 +356,7 @@ function amt_heci() {
this.unprovision = function unprovision(mode, callback) {
var optional = [];
for (var i = 2; i < arguments.length; ++i) { optional.push(arguments[i]); }
var data = new Buffer(4);
var data = Buffer.alloc(4);
data.writeUInt32LE(mode, 0);
this.sendCommand(16, data, function (header, fn, opt) {
opt.unshift(header.Status);

View file

@ -729,7 +729,7 @@ function AmtStackCreateService(wsmanStack) {
e = null;
try {
es = atob(responses.Body['EventRecords'][i]);
e = new Buffer(es);
e = Buffer.from(es);
} catch (ex) {
console.log(ex + " " + responses.Body['EventRecords'][i])
}