From 6eefd454e426da6880dfcd87801fb3327ebb6799 Mon Sep 17 00:00:00 2001 From: Oguz Bastemur Date: Thu, 17 Jul 2014 17:01:45 +0200 Subject: [PATCH] async callback ID problem fixed --- backend/jx_rabbit_api.js | 6 +++++- backend/jx_server_handler.js | 1 + node_modules/mediaserver/index.js | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/backend/jx_rabbit_api.js b/backend/jx_rabbit_api.js index 9ddf5b2..91ab842 100755 --- a/backend/jx_rabbit_api.js +++ b/backend/jx_rabbit_api.js @@ -226,7 +226,11 @@ exports.addClientMessage = function (clid, index, message) { if (!clientMessages[clid]) { clientMessages[clid] = {starts: index}; } - clientMessages[clid].ends = index; + + if(clientMessages[clid].starts <= index) + clientMessages[clid].ends = index; + else + clientMessages[clid].starts = index; clientMessages[clid][index] = (message); clientMessages.__count++; diff --git a/backend/jx_server_handler.js b/backend/jx_server_handler.js index 1c36b6f..2e51a9d 100755 --- a/backend/jx_server_handler.js +++ b/backend/jx_server_handler.js @@ -263,6 +263,7 @@ var _ticker = function (clid, moveon) { var end = false; if (p.data.length > 0) { + if (p.res) { if (p.req.desktop) { p.res.write(p.data.join(",") + ","); diff --git a/node_modules/mediaserver/index.js b/node_modules/mediaserver/index.js index 0b1d7c5..0d4482d 100644 --- a/node_modules/mediaserver/index.js +++ b/node_modules/mediaserver/index.js @@ -122,6 +122,7 @@ exports.pipe = function(req, res, path, type){ } else { var file = fs.createReadStream(path, {start: range[0], end: range[1]}); + if(!ext.length || !pipe_extensions[ext]){ if (range[2]) { res.writeHead(206,