mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-01-04 03:56:10 +03:00
Merge branch 'master' of https://github.com/Ylianst/MeshCentral
This commit is contained in:
commit
1f19ffe177
14
meshagent.js
14
meshagent.js
@ -58,7 +58,19 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
|
|||||||
dataAccounting();
|
dataAccounting();
|
||||||
|
|
||||||
if ((arg == 1) || (arg == null)) { try { ws.close(); if (obj.nodeid != null) { parent.parent.debug('agent', 'Soft disconnect ' + obj.nodeid + ' (' + obj.remoteaddrport + ')'); } } catch (e) { console.log(e); } } // Soft close, close the websocket
|
if ((arg == 1) || (arg == null)) { try { ws.close(); if (obj.nodeid != null) { parent.parent.debug('agent', 'Soft disconnect ' + obj.nodeid + ' (' + obj.remoteaddrport + ')'); } } catch (e) { console.log(e); } } // Soft close, close the websocket
|
||||||
if (arg == 2) { try { ws._socket._parent.end(); if (obj.nodeid != null) { parent.parent.debug('agent', 'Hard disconnect ' + obj.nodeid + ' (' + obj.remoteaddrport + ')'); } } catch (e) { console.log(e); } } // Hard close, close the TCP socket
|
if (arg == 2) {
|
||||||
|
try {
|
||||||
|
if (ws._socket._parent != null)
|
||||||
|
ws._socket._parent.end();
|
||||||
|
else
|
||||||
|
ws._socket.end();
|
||||||
|
|
||||||
|
if (obj.nodeid != null) {
|
||||||
|
parent.parent.debug('agent', 'Hard disconnect ' + obj.nodeid + ' (' + obj.remoteaddrport + ')');
|
||||||
|
}
|
||||||
|
} catch (e) { console.log(e); }
|
||||||
|
}
|
||||||
|
// If arg == 2, hard close, close the TCP socket
|
||||||
// If arg == 3, don't communicate with this agent anymore, but don't disconnect (Duplicate agent).
|
// If arg == 3, don't communicate with this agent anymore, but don't disconnect (Duplicate agent).
|
||||||
|
|
||||||
// Stop any current self-share
|
// Stop any current self-share
|
||||||
|
Loading…
Reference in New Issue
Block a user