mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 12:20:27 +01:00
Merge remote-tracking branch 'joyent/master'
This commit is contained in:
commit
6e99742417
|
|
@ -141,8 +141,7 @@ function readableAddChunk(stream, state, chunk, encoding, addToFront) {
|
|||
stream.emit('error', er);
|
||||
} else if (chunk === null) {
|
||||
state.reading = false;
|
||||
if (!state.ended)
|
||||
onEofChunk(stream, state);
|
||||
onEofChunk(stream, state);
|
||||
} else if (state.objectMode || chunk && chunk.length > 0) {
|
||||
if (state.ended && !addToFront) {
|
||||
var e = new Error('stream.push() after EOF');
|
||||
|
|
@ -387,7 +386,8 @@ function chunkInvalid(state, chunk) {
|
|||
|
||||
|
||||
function onEofChunk(stream, state) {
|
||||
if (state.decoder && !state.ended) {
|
||||
if (state.ended) return;
|
||||
if (state.decoder) {
|
||||
var chunk = state.decoder.end();
|
||||
if (chunk && chunk.length) {
|
||||
state.buffer.push(chunk);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user