Added session recording debug.

Ylian Saint-Hilaire committed May 2, 2020 at 00:22 UTC 98897e3c278cbff3a6ff431a332a9d2457592262
3 files changed +9 -2
meshdesktopmultiplex.js
+6 -1
@@ -640,8 +640,13 @@ function CreateDesktopMultiplexor(parent, domain, nodeid, func) {
640 recFullFilename = parent.parent.path.join(parent.parent.recordpath, recFilename);
641 }
642 parent.parent.fs.open(recFullFilename, 'w', function (err, fd) {
643 - if (err != null) { func(false); return; }
643 + if (err != null) {
644 + parent.parent.debug('relay', 'Relay: Unable to record to file: ' + recFullFilename);
645 + func(false);
646 + return;
647 + }
648 // Write the recording file header
649 + parent.parent.debug('relay', 'Relay: Started recoding to file: ' + recFullFilename);
650 var metadata = { magic: 'MeshCentralRelaySession', ver: 1, nodeid: obj.nodeid, time: new Date().toLocaleString(), protocol: 2 };
651 var firstBlock = JSON.stringify(metadata);
652 recordingEntry(fd, 1, 0, firstBlock, function () {
meshrelay.js
+2
@@ -241,10 +241,12 @@ module.exports.CreateMeshRelay = function (parent, ws, req, domain, user, cookie
241 parent.parent.fs.open(recFullFilename, 'w', function (err, fd) {
242 if (err != null) {
243 // Unable to record
244 + parent.parent.debug('relay', 'Relay: Unable to record to file: ' + recFullFilename);
245 try { ws.send('c'); } catch (ex) { } // Send connect to both peers
246 try { relayinfo.peer1.ws.send('c'); } catch (ex) { }
247 } else {
248 // Write the recording file header
249 + parent.parent.debug('relay', 'Relay: Started recoding to file: ' + recFullFilename);
250 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 ) };
251 if (xdevicename2 != null) { metadata.devicename = xdevicename2; }
252 var firstBlock = JSON.stringify(metadata);
package.json
+1 -1
@@ -1,6 +1,6 @@
1 {
2 "name": "meshcentral",
3 - "version": "0.5.19",
3 + "version": "0.5.20",
4 "keywords": [
5 "Remote Management",
6 "Intel AMT",