Permalink
Browse files

Set flowing when starting the flow

  • Loading branch information...
1 parent 758ac0e commit bd5e043f0432100806e420d16e29691c71eab932 @isaacs isaacs committed Oct 4, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 readable.js
View
5 readable.js
@@ -193,16 +193,17 @@ Readable.prototype.pipe = function(dest, pipeOpts) {
dest.emit('pipe', src);
// start the flow.
- if (!state.flowing)
+ if (!state.flowing) {
+ state.flowing = true;
process.nextTick(flow.bind(null, src, pipeOpts));
+ }
return dest;
};
function flow(src, pipeOpts) {
var state = src._readableState;
var chunk;
- var dest;
var needDrain = 0;
function ondrain() {

0 comments on commit bd5e043

Please sign in to comment.