From fed2eccdfbcfe97e976c1292bf9230e637f884b8 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 17 Oct 2013 15:49:36 +0000 Subject: [PATCH] feature(cloudcmd) change logs: rm pathname, request, name; add method, data --- cloudcmd.js | 2 +- lib/server.js | 7 +------ lib/server/main.js | 9 +++++---- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/cloudcmd.js b/cloudcmd.js index 3007fec2..4a72b2bf 100644 --- a/cloudcmd.js +++ b/cloudcmd.js @@ -325,7 +325,7 @@ main.sendResponse(p, indexProcessing({ additional : lList, data : pData.toString(), - })); + }), true); } else main.sendError(pParams, pError); diff --git a/lib/server.js b/lib/server.js index a9eaad10..205059a2 100644 --- a/lib/server.js +++ b/lib/server.js @@ -150,9 +150,7 @@ /* added supporting of Russian language in directory names */ lPath = Querystring.unescape(lPath); - Util.log('pathname: ' + lPath); - - Util.log("request for " + lPath + " received..."); + Util.log(pReq.method + ': ' + lPath); var lData = { name : lPath, @@ -168,14 +166,11 @@ if(!lRet) { lName = lData.name; - Util.log('reading ' + lName); /* watching is file changed */ if(lConfig.appcache) AppCache.watch(lName); - Util.log(Path.basename(lName)); - lName = Path.join(DIR, lName); lMin = Minify.allowed, lExt = Util.getExtension(lName), diff --git a/lib/server/main.js b/lib/server/main.js index 49c5d2bf..a983c73b 100644 --- a/lib/server/main.js +++ b/lib/server/main.js @@ -258,7 +258,7 @@ * @param Data - данные * @param pName - имя отсылаемого файла */ - function sendResponse(pParams, pData){ + function sendResponse(pParams, pData, pNotLog) { var lRet = checkParams(pParams); if(lRet){ @@ -273,7 +273,10 @@ gzip : lGzip, query : lQuery }); - + + if (!pNotLog) + Util.log(pData || p.data); + /* если браузер поддерживает gzip-сжатие - сжимаем данные*/ Util.ifExec(!lGzip, function(pParams) { @@ -286,8 +289,6 @@ p.response.writeHead(p.status || OK, lHead); p.response.end(p.data); - - Util.log( p.name + ' sended'); }, function(pCallBack) {