summaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorAleš Smodiš <aless@guru.si>2015-10-07 18:34:01 +0200
committerAleš Smodiš <aless@guru.si>2015-10-07 18:34:01 +0200
commit12cab148ae6da9eea11e0b9c60340ce2c5fca3ba (patch)
tree3150b54ec7d85645ea28fc4bdab986769ca2ee6b /web
parent1655eb3b4859c21fa2766c2574e8919a831f220e (diff)
Bugfix: make the as yet unimplemented meta protocol not generate errors on the Python side.
Diffstat (limited to 'web')
-rw-r--r--web/main.js10
1 files changed, 5 insertions, 5 deletions
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);
});