From 78e855d0ab31551921fe7192202d209adf3e987f Mon Sep 17 00:00:00 2001 From: Mihai Potra Date: Sun, 15 Oct 2017 11:31:24 +0300 Subject: [PATCH] stream: Fix flow stalled after unpipe() --- lib/_stream_readable.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js index 081d1592f60c73..45f31625d9f705 100644 --- a/lib/_stream_readable.js +++ b/lib/_stream_readable.js @@ -626,6 +626,10 @@ Readable.prototype.pipe = function(dest, pipeOpts) { if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); + + if (EE.listenerCount(src, 'data') > 0) { + state.flowing = true; + } } // If the user pushes more data while we're writing to dest then we'll end up