Fixed server crash on unknown CIRA device connection, #3036

Ylian Saint-Hilaire committed Aug 17, 2021 at 12:28 UTC 348cd452ffbf782b4215d540dd8555d4f71f2e69
1 file changed +3 -3
mpsserver.js
+3 -3
@@ -280,7 +280,7 @@ module.exports.CreateMpsServer = function (parent, db, args, certificates) {
280 obj.onWebSocketConnection = function (socket, req) {
281 connectionCount++;
282 // connType: 0 = CIRA, 1 = Relay, 2 = LMS
283 - socket.tag = { first: true, connType: 0, clientCert: null, accumulator: '', activetunnels: 0, boundPorts: [], websocket: true, socket: socket, host: null, nextchannelid: 4, channels: {}, nextsourceport: 0 };
283 + socket.tag = { first: true, connType: 0, clientCert: null, accumulator: '', activetunnels: 0, boundPorts: [], websocket: true, socket: socket, host: null, nextchannelid: 4, channels: {}, nextsourceport: 0, meiState: {} };
284 socket.SetupChannel = function SetupChannel(targetport) { return SetupChannel.parent.SetupChannel(SetupChannel.conn, targetport); }
285 socket.SetupChannel.parent = obj;
286 socket.SetupChannel.conn = socket;
@@ -337,9 +337,9 @@ module.exports.CreateMpsServer = function (parent, db, args, certificates) {
337 connectionCount++;
338 // connType: 0 = CIRA, 1 = Relay, 2 = LMS
339 if (obj.args.mpstlsoffload) {
340 - socket.tag = { first: true, connType: 0, clientCert: null, accumulator: '', activetunnels: 0, boundPorts: [], socket: socket, host: null, nextchannelid: 4, channels: {}, nextsourceport: 0 };
340 + socket.tag = { first: true, connType: 0, clientCert: null, accumulator: '', activetunnels: 0, boundPorts: [], socket: socket, host: null, nextchannelid: 4, channels: {}, nextsourceport: 0, meiState: {} };
341 } else {
342 - socket.tag = { first: true, connType: 0, clientCert: socket.getPeerCertificate(true), accumulator: '', activetunnels: 0, boundPorts: [], socket: socket, host: null, nextchannelid: 4, channels: {}, nextsourceport: 0 };
342 + socket.tag = { first: true, connType: 0, clientCert: socket.getPeerCertificate(true), accumulator: '', activetunnels: 0, boundPorts: [], socket: socket, host: null, nextchannelid: 4, channels: {}, nextsourceport: 0, meiState: {} };
343 }
344 socket.SetupChannel = function SetupChannel(targetport) { return SetupChannel.parent.SetupChannel(SetupChannel.conn, targetport); }
345 socket.SetupChannel.parent = obj;