stream: fix no data on partial decode#5226
Closed
mscdex wants to merge 1 commit intonodejs:masterfrom
Closed
Conversation
873406b to
355b6c4
Compare
Contributor
Author
lib/_stream_readable.js
Outdated
Member
There was a problem hiding this comment.
I would add a little comment here just to clarify why this is being introduced.
Member
|
LGTM. Just a quick check, any perf regression? That |
Before this commit, it was possible to push a partial character to a readable stream where it was decoded as an empty string and then added to the internal buffer. This caused the stream to not emit any data, even when the rest of the character bytes were pushed separately, because of a non-zero length check of the first chunk in the internal buffer. Fixes: nodejs#5223
355b6c4 to
bbabbee
Compare
Contributor
Author
|
No idea about perf, there aren't any pure stream benchmarks at the moment. |
Member
|
The net ones support passing both buffers and utf8 encoded things, you should be able to get some data (with some noise) |
Contributor
Author
|
IMHO there'd be too much variance in those benchmarks to measure any performance difference with a change like this. No matter what though, the bug needs to be fixed. |
Member
|
Agreed, LGTM. |
Member
|
LGTM |
mscdex
added a commit
that referenced
this pull request
Feb 17, 2016
Before this commit, it was possible to push a partial character to a readable stream where it was decoded as an empty string and then added to the internal buffer. This caused the stream to not emit any data, even when the rest of the character bytes were pushed separately, because of a non-zero length check of the first chunk in the internal buffer. Fixes: #5223 PR-URL: #5226 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Contributor
Author
|
Landed in 9221201. |
rvagg
pushed a commit
that referenced
this pull request
Feb 18, 2016
Before this commit, it was possible to push a partial character to a readable stream where it was decoded as an empty string and then added to the internal buffer. This caused the stream to not emit any data, even when the rest of the character bytes were pushed separately, because of a non-zero length check of the first chunk in the internal buffer. Fixes: #5223 PR-URL: #5226 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins
pushed a commit
that referenced
this pull request
Mar 1, 2016
Before this commit, it was possible to push a partial character to a readable stream where it was decoded as an empty string and then added to the internal buffer. This caused the stream to not emit any data, even when the rest of the character bytes were pushed separately, because of a non-zero length check of the first chunk in the internal buffer. Fixes: #5223 PR-URL: #5226 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins
pushed a commit
that referenced
this pull request
Mar 17, 2016
Before this commit, it was possible to push a partial character to a readable stream where it was decoded as an empty string and then added to the internal buffer. This caused the stream to not emit any data, even when the rest of the character bytes were pushed separately, because of a non-zero length check of the first chunk in the internal buffer. Fixes: #5223 PR-URL: #5226 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins
pushed a commit
that referenced
this pull request
Mar 21, 2016
Before this commit, it was possible to push a partial character to a readable stream where it was decoded as an empty string and then added to the internal buffer. This caused the stream to not emit any data, even when the rest of the character bytes were pushed separately, because of a non-zero length check of the first chunk in the internal buffer. Fixes: #5223 PR-URL: #5226 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before this commit, it was possible to push a partial character to a readable stream where it was decoded as an empty string and then added to the internal buffer. This caused the stream to not emit any data,
even when the rest of the character bytes were pushed separately, because of a non-zero length check of the first chunk in the internal buffer.
Fixes: #5223