-
-
Save HomerSp/07ec63dacf49aac5f55a62b7c09dc313 to your computer and use it in GitHub Desktop.
readable.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/internal/streams/readable.js b/lib/internal/streams/readable.js | |
index 93153908fe..366a2a5ad6 100644 | |
--- a/lib/internal/streams/readable.js | |
+++ b/lib/internal/streams/readable.js | |
@@ -787,6 +787,11 @@ Readable.prototype.pipe = function(dest, pipeOpts) { | |
if (dest.writableNeedDrain === true) { | |
if (state.flowing) { | |
src.pause(); | |
+ | |
+ // Resume src when we can | |
+ dest.once('drain', function() { | |
+ src.resume(); | |
+ }); | |
} | |
} else if (!state.flowing) { | |
debug('pipe resume'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment