From 591616f37feea7ffa532cb53cb1f4415679821bb Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Fri, 25 Sep 2020 18:40:01 +0200 Subject: [PATCH 1/5] stream: writableNeedDrain Don't write to a stream which already has a full buffer. Fixes: https://github.com/nodejs/node/issues/35341 --- doc/api/stream.md | 9 ++++++ lib/_http_outgoing.js | 5 +++ lib/internal/streams/duplex.js | 2 ++ lib/internal/streams/pipeline.js | 4 +++ lib/internal/streams/readable.js | 55 +++++++++++++++++++------------- lib/internal/streams/writable.js | 8 +++++ 6 files changed, 60 insertions(+), 23 deletions(-) diff --git a/doc/api/stream.md b/doc/api/stream.md index 97e848f56fa1fa..7f09c4d216eedf 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -573,6 +573,15 @@ This property contains the number of bytes (or objects) in the queue ready to be written. The value provides introspection data regarding the status of the `highWaterMark`. +##### `writable.writableNeedDrain` + + +* {boolean} + +Is `true` if buffer is full. + ##### `writable.writableObjectMode`