diff options
Diffstat (limited to 'lib/_stream_readable.js')
-rw-r--r-- | lib/_stream_readable.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js index 8db8848ba1..1fe5e0573d 100644 --- a/lib/_stream_readable.js +++ b/lib/_stream_readable.js @@ -495,6 +495,7 @@ Readable.prototype.read = function(n) { }; function onEofChunk(stream, state) { + debug('onEofChunk'); if (state.ended) return; if (state.decoder) { var chunk = state.decoder.end(); @@ -525,6 +526,7 @@ function onEofChunk(stream, state) { // a nextTick recursion warning, but that's not so bad. function emitReadable(stream) { var state = stream._readableState; + debug('emitReadable', state.needReadable, state.emittedReadable); state.needReadable = false; if (!state.emittedReadable) { debug('emitReadable', state.flowing); @@ -538,6 +540,7 @@ function emitReadable_(stream) { debug('emitReadable_', state.destroyed, state.length, state.ended); if (!state.destroyed && (state.length || state.ended)) { stream.emit('readable'); + state.emittedReadable = false; } // The stream needs another readable event if |