aboutsummaryrefslogtreecommitdiff
path: root/lib/net.js
diff options
context:
space:
mode:
authorLuigi Pinca <luigipinca@gmail.com>2019-05-31 20:36:23 +0200
committerRuben Bridgewater <ruben@bridgewater.de>2019-06-17 19:49:43 +0200
commitdfbbfbb765e46899b67ce5c7cab6c2bb618c8f68 (patch)
treee0a28cd1c274a1da7997bb974b5b516013a9cca3 /lib/net.js
parente5c26753e9764c484e09eda3f20c31d2d48e6ed0 (diff)
downloadandroid-node-v8-dfbbfbb765e46899b67ce5c7cab6c2bb618c8f68.tar.gz
android-node-v8-dfbbfbb765e46899b67ce5c7cab6c2bb618c8f68.tar.bz2
android-node-v8-dfbbfbb765e46899b67ce5c7cab6c2bb618c8f68.zip
net: make writeAfterFIN() return false
If `false` is not returned a readable stream piped into the socket might continue reading indefinitely until the process goes out of memory. PR-URL: https://github.com/nodejs/node/pull/27996 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'lib/net.js')
-rw-r--r--lib/net.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/net.js b/lib/net.js
index 54ddaa3b40..6c2bf56875 100644
--- a/lib/net.js
+++ b/lib/net.js
@@ -410,6 +410,8 @@ function writeAfterFIN(chunk, encoding, cb) {
if (typeof cb === 'function') {
defaultTriggerAsyncIdScope(this[async_id_symbol], process.nextTick, cb, er);
}
+
+ return false;
}
Socket.prototype.setTimeout = setStreamTimeout;