From 348cd452ffbf782b4215d540dd8555d4f71f2e69 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Tue, 17 Aug 2021 12:28:46 -0700 Subject: [PATCH] Fixed server crash on unknown CIRA device connection, #3036 --- mpsserver.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mpsserver.js b/mpsserver.js index cfb32457..26effacc 100644 --- a/mpsserver.js +++ b/mpsserver.js @@ -280,7 +280,7 @@ module.exports.CreateMpsServer = function (parent, db, args, certificates) { obj.onWebSocketConnection = function (socket, req) { connectionCount++; // connType: 0 = CIRA, 1 = Relay, 2 = LMS - socket.tag = { first: true, connType: 0, clientCert: null, accumulator: '', activetunnels: 0, boundPorts: [], websocket: true, socket: socket, host: null, nextchannelid: 4, channels: {}, nextsourceport: 0 }; + socket.tag = { first: true, connType: 0, clientCert: null, accumulator: '', activetunnels: 0, boundPorts: [], websocket: true, socket: socket, host: null, nextchannelid: 4, channels: {}, nextsourceport: 0, meiState: {} }; socket.SetupChannel = function SetupChannel(targetport) { return SetupChannel.parent.SetupChannel(SetupChannel.conn, targetport); } socket.SetupChannel.parent = obj; socket.SetupChannel.conn = socket; @@ -337,9 +337,9 @@ module.exports.CreateMpsServer = function (parent, db, args, certificates) { connectionCount++; // connType: 0 = CIRA, 1 = Relay, 2 = LMS if (obj.args.mpstlsoffload) { - socket.tag = { first: true, connType: 0, clientCert: null, accumulator: '', activetunnels: 0, boundPorts: [], socket: socket, host: null, nextchannelid: 4, channels: {}, nextsourceport: 0 }; + socket.tag = { first: true, connType: 0, clientCert: null, accumulator: '', activetunnels: 0, boundPorts: [], socket: socket, host: null, nextchannelid: 4, channels: {}, nextsourceport: 0, meiState: {} }; } else { - socket.tag = { first: true, connType: 0, clientCert: socket.getPeerCertificate(true), accumulator: '', activetunnels: 0, boundPorts: [], socket: socket, host: null, nextchannelid: 4, channels: {}, nextsourceport: 0 }; + socket.tag = { first: true, connType: 0, clientCert: socket.getPeerCertificate(true), accumulator: '', activetunnels: 0, boundPorts: [], socket: socket, host: null, nextchannelid: 4, channels: {}, nextsourceport: 0, meiState: {} }; } socket.SetupChannel = function SetupChannel(targetport) { return SetupChannel.parent.SetupChannel(SetupChannel.conn, targetport); } socket.SetupChannel.parent = obj;