RDP integration fixes.

This commit is contained in:
Ylian Saint-Hilaire 2022-05-04 14:18:04 -07:00
parent f24c38a7b2
commit fa07d414c6
2 changed files with 3 additions and 3 deletions

View File

@ -114,7 +114,7 @@ module.exports.CreateMstscRelay = function (parent, db, ws, req, args, domain) {
obj.relayActive = true; obj.relaySocket.resume();
} else {
obj.wsClient._socket.pause();
try { obj.relaySocket.write(data, function () { obj.wsClient._socket.resume(); }); } catch (ex) { obj.close(); }
try { obj.relaySocket.write(data, function () { try { obj.wsClient._socket.resume(); } catch (ex) { } }); } catch (ex) { obj.close(); }
}
});
obj.wsClient.on('close', function () { parent.parent.debug('relay', 'RDP: Relay websocket closed'); obj.close(); });
@ -186,7 +186,7 @@ module.exports.CreateMstscRelay = function (parent, db, ws, req, args, domain) {
// Event node change if needed
if (changed) {
// Event the node change
const event = { etype: 'node', action: 'changenode', nodeid: obj.nodeid, domain: domain.id, userid: obj.cookie.userid, node: parent.CloneSafeNode(node), msg: "Changed RDP credentials" };
const event = { etype: 'node', action: 'changenode', nodeid: obj.nodeid, domain: domain.id, userid: obj.userid, node: parent.CloneSafeNode(node), msg: "Changed RDP credentials" };
if (parent.parent.db.changeStream) { event.noact = 1; } // If DB change stream is active, don't use this event to change the node. Another event will come.
parent.parent.DispatchEvent(parent.CreateMeshDispatchTargets(node.meshid, [obj.nodeid]), obj, event);
}

View File

@ -8588,7 +8588,7 @@
if ((currentNode.rdp == 1) && (Q('d2mode').value == 1)) {
connectDesktop(null, 4, { servercred: true, width: width, height: height, flags: (desktopsettings.rdpflags != null) ? desktopsettings.rdpflags : 0x2F });
} else {
savecred = false;
var savecred = false;
if ((features2 & 0x00400000) == 0) { savecred = Q('d2savecred').checked; }
connectDesktop(null, 4, { domain: Q('d2domain').value, username: Q('d2user').value, password: Q('d2pass').value, savecred: savecred, width: width, height: height, flags: (desktopsettings.rdpflags != null) ? desktopsettings.rdpflags : 0x2F });
}