diff options
author | Luigi Pinca <luigipinca@gmail.com> | 2017-03-19 22:58:31 +0300 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2017-03-22 20:26:02 +0300 |
commit | e0a9ad1af244f8756a228a6d087b3a55ee4c0d14 (patch) | |
tree | 051c4f5802e1daa45647def9bfab78709183f0f3 /lib/internal/http.js | |
parent | 4eb194a2b10194f3ac1a4c8914d725aa90da265e (diff) |
http: avoid retaining unneeded memory
Prevent the events listeners of the sockets obtained with the HTTP
upgrade mechanism from retaining unneeded memory.
Ref: https://github.com/nodejs/node/issues/11868
PR-URL: https://github.com/nodejs/node/pull/11926
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'lib/internal/http.js')
-rw-r--r-- | lib/internal/http.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/internal/http.js b/lib/internal/http.js index 1ba68a41a56..0b12bc7c8fb 100644 --- a/lib/internal/http.js +++ b/lib/internal/http.js @@ -1,5 +1,10 @@ 'use strict'; +function ondrain() { + if (this._httpMessage) this._httpMessage.emit('drain'); +} + module.exports = { - outHeadersKey: Symbol('outHeadersKey') + outHeadersKey: Symbol('outHeadersKey'), + ondrain, }; |