summaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
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);
});