Fixed typo, where an exception was thrown when trying to send server log, if user consent was enabled

This commit is contained in:
Bryan Roe 2019-08-05 15:13:32 -07:00
parent ba78910fc9
commit f0c6bffc75

View File

@ -1072,7 +1072,7 @@ function createMeshCore(agent)
pr.then( pr.then(
function () { function () {
// Success // Success
MeshServerLog('Starting remote terminal after local user accepted (' + this.httprequest.remoteaddr + ')', this.httprequest); MeshServerLog('Starting remote terminal after local user accepted (' + this.ws.httprequest.remoteaddr + ')', this.ws.httprequest);
this.ws.write(JSON.stringify({ ctrlChannel: '102938', type: 'console', msg: null })); this.ws.write(JSON.stringify({ ctrlChannel: '102938', type: 'console', msg: null }));
if (this.ws.httprequest.consent && (this.ws.httprequest.consent & 2)) { if (this.ws.httprequest.consent && (this.ws.httprequest.consent & 2)) {
// User Notifications is required // User Notifications is required
@ -1082,7 +1082,7 @@ function createMeshCore(agent)
}, },
function (e) { function (e) {
// User Consent Denied/Failed // User Consent Denied/Failed
MeshServerLog('Failed to start remote terminal after local user rejected (' + this.httprequest.remoteaddr + ')', this.httprequest); MeshServerLog('Failed to start remote terminal after local user rejected (' + this.ws.httprequest.remoteaddr + ')', this.ws.httprequest);
this.ws.write(JSON.stringify({ ctrlChannel: '102938', type: 'console', msg: e.toString() })); this.ws.write(JSON.stringify({ ctrlChannel: '102938', type: 'console', msg: e.toString() }));
this.ws.end(); this.ws.end();
}); });
@ -1163,7 +1163,7 @@ function createMeshCore(agent)
function () function ()
{ {
// Success // Success
MeshServerLog('Starting remote desktop after local user accepted (' + this.httprequest.remoteaddr + ')', this.httprequest); MeshServerLog('Starting remote desktop after local user accepted (' + this.ws.httprequest.remoteaddr + ')', this.ws.httprequest);
this.ws.write(JSON.stringify({ ctrlChannel: '102938', type: 'console', msg: null })); this.ws.write(JSON.stringify({ ctrlChannel: '102938', type: 'console', msg: null }));
if (this.ws.httprequest.consent && (this.ws.httprequest.consent & 1)) { if (this.ws.httprequest.consent && (this.ws.httprequest.consent & 1)) {
// User Notifications is required // User Notifications is required
@ -1175,7 +1175,7 @@ function createMeshCore(agent)
function (e) function (e)
{ {
// User Consent Denied/Failed // User Consent Denied/Failed
MeshServerLog('Failed to start remote desktop after local user rejected (' + this.httprequest.remoteaddr + ')', this.httprequest); MeshServerLog('Failed to start remote desktop after local user rejected (' + this.ws.httprequest.remoteaddr + ')', this.ws.httprequest);
this.ws.end(JSON.stringify({ ctrlChannel: '102938', type: 'console', msg: e.toString() })); this.ws.end(JSON.stringify({ ctrlChannel: '102938', type: 'console', msg: e.toString() }));
}); });
} }
@ -1220,7 +1220,7 @@ function createMeshCore(agent)
pr.then( pr.then(
function () { function () {
// Success // Success
MeshServerLog('Starting remote files after local user accepted (' + this.httprequest.remoteaddr + ')', this.httprequest); MeshServerLog('Starting remote files after local user accepted (' + this.ws.httprequest.remoteaddr + ')', this.ws.httprequest);
this.ws.write(JSON.stringify({ ctrlChannel: '102938', type: 'console', msg: null })); this.ws.write(JSON.stringify({ ctrlChannel: '102938', type: 'console', msg: null }));
if (this.ws.httprequest.consent && (this.ws.httprequest.consent & 4)) { if (this.ws.httprequest.consent && (this.ws.httprequest.consent & 4)) {
// User Notifications is required // User Notifications is required
@ -1230,7 +1230,7 @@ function createMeshCore(agent)
}, },
function (e) { function (e) {
// User Consent Denied/Failed // User Consent Denied/Failed
MeshServerLog('Failed to start remote files after local user rejected (' + this.httprequest.remoteaddr + ')', this.httprequest); MeshServerLog('Failed to start remote files after local user rejected (' + this.ws.httprequest.remoteaddr + ')', this.ws.httprequest);
this.ws.end(JSON.stringify({ ctrlChannel: '102938', type: 'console', msg: e.toString() })); this.ws.end(JSON.stringify({ ctrlChannel: '102938', type: 'console', msg: e.toString() }));
}); });
} else { } else {