diff options
author | Alexander Borisov <alexander.borisov@nginx.com> | 2018-11-15 15:24:45 +0300 |
---|---|---|
committer | Alexander Borisov <alexander.borisov@nginx.com> | 2018-11-15 15:24:45 +0300 |
commit | 71f4cb91340b656397eaaa356755b4a1e31c8010 (patch) | |
tree | 313983835d7afad1775f9233afaab2eeea1be573 /src/nodejs/unit-http/http_server.js | |
parent | b033fb329fc14e6469596821508c487e3ed6ff82 (diff) | |
download | unit-71f4cb91340b656397eaaa356755b4a1e31c8010.tar.gz unit-71f4cb91340b656397eaaa356755b4a1e31c8010.tar.bz2 |
Node.js: added reference count increment for the Unit object.
We increase the number to the Unit object so that it lives forever.
This is necessary so that the garbage collector does not delete the Unit object.
Diffstat (limited to 'src/nodejs/unit-http/http_server.js')
-rwxr-xr-x | src/nodejs/unit-http/http_server.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/nodejs/unit-http/http_server.js b/src/nodejs/unit-http/http_server.js index ddacb420..b35ad259 100755 --- a/src/nodejs/unit-http/http_server.js +++ b/src/nodejs/unit-http/http_server.js @@ -333,6 +333,8 @@ Server.prototype.run_events = function (server, req, res) { }); Promise.resolve().then(() => { + req.emit("finish"); + if (res.finished) { unit_lib.unit_response_end(res); } |