streams2: Set flowing=true when flowing
This commit is contained in:
parent
639fbe28d1
commit
51a52c43a2
@ -159,8 +159,10 @@ Readable.prototype.pipe = function(dest, pipeOpts) {
|
|||||||
dest.emit('pipe', src);
|
dest.emit('pipe', src);
|
||||||
|
|
||||||
// start the flow.
|
// start the flow.
|
||||||
if (!state.flowing)
|
if (!state.flowing) {
|
||||||
|
state.flowing = true;
|
||||||
process.nextTick(flow.bind(null, src, pipeOpts));
|
process.nextTick(flow.bind(null, src, pipeOpts));
|
||||||
|
}
|
||||||
|
|
||||||
return dest;
|
return dest;
|
||||||
};
|
};
|
||||||
@ -168,7 +170,6 @@ Readable.prototype.pipe = function(dest, pipeOpts) {
|
|||||||
function flow(src, pipeOpts) {
|
function flow(src, pipeOpts) {
|
||||||
var state = src._readableState;
|
var state = src._readableState;
|
||||||
var chunk;
|
var chunk;
|
||||||
var dest;
|
|
||||||
var needDrain = 0;
|
var needDrain = 0;
|
||||||
|
|
||||||
function ondrain() {
|
function ondrain() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user