Added session recording debug.

This commit is contained in:
Ylian Saint-Hilaire 2020-05-02 00:22:54 -07:00
parent d7517b3dd2
commit 832cc67436
3 changed files with 9 additions and 2 deletions

View File

@ -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 () {

View File

@ -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);

View File

@ -1,6 +1,6 @@
{
"name": "meshcentral",
"version": "0.5.19",
"version": "0.5.20",
"keywords": [
"Remote Management",
"Intel AMT",