summaryrefslogtreecommitdiff
path: root/lib/internal/http.js
diff options
context:
space:
mode:
authorLuigi Pinca <luigipinca@gmail.com>2017-03-19 20:58:31 +0100
committerJames M Snell <jasnell@gmail.com>2017-03-22 10:26:02 -0700
commite0a9ad1af244f8756a228a6d087b3a55ee4c0d14 (patch)
tree051c4f5802e1daa45647def9bfab78709183f0f3 /lib/internal/http.js
parent4eb194a2b10194f3ac1a4c8914d725aa90da265e (diff)
downloadandroid-node-v8-e0a9ad1af244f8756a228a6d087b3a55ee4c0d14.tar.gz
android-node-v8-e0a9ad1af244f8756a228a6d087b3a55ee4c0d14.tar.bz2
android-node-v8-e0a9ad1af244f8756a228a6d087b3a55ee4c0d14.zip
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.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/internal/http.js b/lib/internal/http.js
index 1ba68a41a5..0b12bc7c8f 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,
};