summaryrefslogtreecommitdiff
path: root/lib/net.js
diff options
context:
space:
mode:
authorLuigi Pinca <luigipinca@gmail.com>2019-05-31 20:36:23 +0200
committerDaniel Bevenius <daniel.bevenius@gmail.com>2019-06-04 06:02:58 +0200
commit714a32c41f7cedec76cd7a237ac12f4cee7fcf85 (patch)
treede324195811545e2cb71fd7717d6e69b86529449 /lib/net.js
parentd9117896a6fd4e5fb0edd0f90be9c7a01649ff3f (diff)
downloadandroid-node-v8-714a32c41f7cedec76cd7a237ac12f4cee7fcf85.tar.gz
android-node-v8-714a32c41f7cedec76cd7a237ac12f4cee7fcf85.tar.bz2
android-node-v8-714a32c41f7cedec76cd7a237ac12f4cee7fcf85.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;