mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-03-09 15:40:18 +00:00
All JavaScript code is now 'strict'
This commit is contained in:
parent
f6b6fe9506
commit
312b937e62
29 changed files with 129 additions and 78 deletions
|
@ -6,6 +6,8 @@
|
|||
* @version v0.0.1
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
var AgentConnectCount = 0;
|
||||
|
||||
// Construct a MeshAgent object, called upon connection
|
||||
|
@ -423,9 +425,10 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
|
|||
|
||||
// Process incoming agent JSON data
|
||||
function processAgentData(msg) {
|
||||
var str = msg.toString('utf8');
|
||||
var str = msg.toString('utf8'), command = null;
|
||||
if (str[0] == '{') {
|
||||
try { command = JSON.parse(str) } catch (e) { console.log('Unable to parse agent JSON (' + obj.remoteaddr + '): ' + str); return; } // If the command can't be parsed, ignore it.
|
||||
try { command = JSON.parse(str) } catch (ex) { console.log('Unable to parse agent JSON (' + obj.remoteaddr + '): ' + str, ex); return; } // If the command can't be parsed, ignore it.
|
||||
if (typeof command != 'object') { return; }
|
||||
switch (command.action) {
|
||||
case 'msg':
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue