From 12cab148ae6da9eea11e0b9c60340ce2c5fca3ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=C5=A1=20Smodi=C5=A1?= Date: Wed, 7 Oct 2015 18:34:01 +0200 Subject: Bugfix: make the as yet unimplemented meta protocol not generate errors on the Python side. --- web/main.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'web') diff --git a/web/main.js b/web/main.js index a4dbf08..37729b9 100644 --- a/web/main.js +++ b/web/main.js @@ -443,16 +443,16 @@ var connectPython = function connectPythonFunc() { pythonClient.on('connect', function () { // login to the python server by sending it the list of currently handled sessions - var sid, sessions = [], packet; + var sid, sessionList = [], packet; logger.debug('Connection to Python established'); for (sid in sessions) { - if (sessions.hasOwnProperty(sid)) { - sessions.push({'sid': sid, 'lastActivity': sessions[sid].lastActivity}); + if (sessionList.hasOwnProperty(sid)) { + sessionList.push({'sid': sid, 'lastActivity': sessionList[sid].lastActivity}); } } // this should/must succeed in sending right now, as it is the first write ever made on the socket - packet = JSON.stringify({'type': 'connect', 'sessions': sessions}); - packet = packet.length + ':' + packet; + packet = JSON.stringify({'type': 'connect', 'sessions': sessionList}); + packet = new Buffer(Buffer.byteLength(packet) + ':' + packet); sendPacketToPython(packet); }); -- cgit v1.2.1