Update to RedBrick 2.6.0
This commit is contained in:
parent
85e40c9396
commit
ebd67f5382
2 changed files with 14 additions and 3 deletions
15
index.js
15
index.js
|
@ -224,7 +224,7 @@ Mod.prototype.callback = function (req, res, serverconsole, responseEnd, href, e
|
|||
}
|
||||
});
|
||||
var dataHandler = function (data) {
|
||||
buffer += data.toString("latin1");
|
||||
if (!cned) buffer += data.toString("latin1");
|
||||
var m = null;
|
||||
if (!cned) m = buffer.match(/(?:\r\n\r\n|\n\r\n\r|\n\n|\r\r)/);
|
||||
if (!cned && m) {
|
||||
|
@ -282,6 +282,8 @@ Mod.prototype.callback = function (req, res, serverconsole, responseEnd, href, e
|
|||
res.writeHead(code, msg, bheaderso);
|
||||
res.write(buffer.substr(headerendline + eol.length), "latin1");
|
||||
} catch (ex) {
|
||||
interpreter.removeAllListeners("exit");
|
||||
interpreter.stdout.removeAllListeners("data");
|
||||
if (!callServerError) {
|
||||
res.writeHead(500);
|
||||
res.end(ex.stack);
|
||||
|
@ -291,7 +293,11 @@ Mod.prototype.callback = function (req, res, serverconsole, responseEnd, href, e
|
|||
return;
|
||||
}
|
||||
} else {
|
||||
if (cned && !res.finished) res.write(data);
|
||||
if (cned && !res.finished) {
|
||||
res.write(data);
|
||||
interpreter.stdout.removeListener("data", dataHandler);
|
||||
interpreter.stdout.pipe(res, {end: false});
|
||||
}
|
||||
}
|
||||
};
|
||||
if (interpreter.stdout) {
|
||||
|
@ -310,6 +316,11 @@ Mod.prototype.callback = function (req, res, serverconsole, responseEnd, href, e
|
|||
callServerError(500, "RedBrick/" + version, ex);
|
||||
}
|
||||
} else {
|
||||
var preparedStderr = stderr.trim()
|
||||
if(preparedStderr) {
|
||||
serverconsole.errmessage("There were CGI application errors:");
|
||||
serverconsole.errmessage(preparedStderr);
|
||||
}
|
||||
res.end();
|
||||
}
|
||||
});
|
||||
|
|
2
mod.info
2
mod.info
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"name": "RedBrick CGI engine for SVR.JS",
|
||||
"version": "2.5.6"
|
||||
"version": "2.6.0"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue