Update to RedBrick 2.6.1
This commit is contained in:
parent
ebd67f5382
commit
c45349c677
2 changed files with 12 additions and 2 deletions
12
index.js
12
index.js
|
@ -297,9 +297,17 @@ Mod.prototype.callback = function (req, res, serverconsole, responseEnd, href, e
|
|||
res.write(data);
|
||||
interpreter.stdout.removeListener("data", dataHandler);
|
||||
interpreter.stdout.pipe(res, {end: false});
|
||||
dataHandler = function () {}; //Prevent event listener memory leaks
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
res.prependListener("close", function() {
|
||||
if(interpreter.stdout) interpreter.stdout.unpipe(res); //Prevent server crashes with write after the end
|
||||
});
|
||||
|
||||
res.on("error", function() {}); //Suppress response stream errors
|
||||
|
||||
if (interpreter.stdout) {
|
||||
interpreter.stdout.on("data", dataHandler);
|
||||
interpreter.stderr.on("data", function (data) {
|
||||
|
@ -321,7 +329,9 @@ Mod.prototype.callback = function (req, res, serverconsole, responseEnd, href, e
|
|||
serverconsole.errmessage("There were CGI application errors:");
|
||||
serverconsole.errmessage(preparedStderr);
|
||||
}
|
||||
res.end();
|
||||
interpreter.stdout.removeListener("data", dataHandler);
|
||||
interpreter.stdout.unpipe(res); //Prevent server crashes with write after the end
|
||||
if(!res.finished) res.end();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
2
mod.info
2
mod.info
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"name": "RedBrick CGI engine for SVR.JS",
|
||||
"version": "2.6.0"
|
||||
"version": "2.6.1"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue