mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-11-22 12:52:50 +03:00
Added session recording debug.
This commit is contained in:
parent
1c4e8ab607
commit
98897e3c27
@ -640,8 +640,13 @@ function CreateDesktopMultiplexor(parent, domain, nodeid, func) {
|
||||
recFullFilename = parent.parent.path.join(parent.parent.recordpath, recFilename);
|
||||
}
|
||||
parent.parent.fs.open(recFullFilename, 'w', function (err, fd) {
|
||||
if (err != null) { func(false); return; }
|
||||
if (err != null) {
|
||||
parent.parent.debug('relay', 'Relay: Unable to record to file: ' + recFullFilename);
|
||||
func(false);
|
||||
return;
|
||||
}
|
||||
// Write the recording file header
|
||||
parent.parent.debug('relay', 'Relay: Started recoding to file: ' + recFullFilename);
|
||||
var metadata = { magic: 'MeshCentralRelaySession', ver: 1, nodeid: obj.nodeid, time: new Date().toLocaleString(), protocol: 2 };
|
||||
var firstBlock = JSON.stringify(metadata);
|
||||
recordingEntry(fd, 1, 0, firstBlock, function () {
|
||||
|
@ -241,10 +241,12 @@ module.exports.CreateMeshRelay = function (parent, ws, req, domain, user, cookie
|
||||
parent.parent.fs.open(recFullFilename, 'w', function (err, fd) {
|
||||
if (err != null) {
|
||||
// Unable to record
|
||||
parent.parent.debug('relay', 'Relay: Unable to record to file: ' + recFullFilename);
|
||||
try { ws.send('c'); } catch (ex) { } // Send connect to both peers
|
||||
try { relayinfo.peer1.ws.send('c'); } catch (ex) { }
|
||||
} else {
|
||||
// Write the recording file header
|
||||
parent.parent.debug('relay', 'Relay: Started recoding to file: ' + recFullFilename);
|
||||
var metadata = { magic: 'MeshCentralRelaySession', ver: 1, userid: sessionUser._id, username: sessionUser.name, sessionid: obj.id, ipaddr1: cleanRemoteAddr(obj.req.ip), ipaddr2: cleanRemoteAddr(obj.peer.req.ip), time: new Date().toLocaleString(), protocol: (((obj.req == null) || (obj.req.query == null)) ? null : obj.req.query.p), nodeid: (((obj.req == null) || (obj.req.query == null)) ? null : obj.req.query.nodeid ) };
|
||||
if (xdevicename2 != null) { metadata.devicename = xdevicename2; }
|
||||
var firstBlock = JSON.stringify(metadata);
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "meshcentral",
|
||||
"version": "0.5.19",
|
||||
"version": "0.5.20",
|
||||
"keywords": [
|
||||
"Remote Management",
|
||||
"Intel AMT",
|
||||
|
Loading…
Reference in New Issue
Block a user