feature(main) sendResponse: params, data, notLog -> data, params, notLog

This commit is contained in:
coderaiser 2014-08-13 09:13:25 -04:00
parent 391db5f83f
commit 73fa821b37
3 changed files with 8 additions and 9 deletions

View file

@ -257,7 +257,7 @@
if (error)
main.sendError(error, p);
else
main.sendResponse(p, data, NOT_LOG);
main.sendResponse(data, p, NOT_LOG);
});
});
}

View file

@ -303,13 +303,13 @@
* @param Data - данные
* @param pName - имя отсылаемого файла
*/
function sendResponse(params, data, notLog) {
function sendResponse(data, params, notLog) {
var p, isGzip, head,
ret = checkParams(params);
if (ret) {
p = params;
data = p.data || data;
data = data;
isGzip = p.gzip && isGZIP(p.request);
head = generateHeaders({
@ -377,14 +377,13 @@
* send error response
*/
function sendError(error, params) {
var p, ret = checkParams(params);
var data, ret = checkParams(params);
if (ret) {
p = params;
p.status = FILE_NOT_FOUND;
p.data = error.message || '' + error;
params.status = FILE_NOT_FOUND;
data = error.message || '' + error;
sendResponse(p);
sendResponse(data, params);
}
}

View file

@ -76,7 +76,7 @@
if (error)
main.sendError(error, params);
else
main.sendResponse(params, data, options.notLog);
main.sendResponse(data, params, options.notLog);
});
}
}