Skip to content

Conversation

@mscdex
Copy link
Contributor

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

@mscdexmscdex added the stream Issues and PRs related to the stream subsystem. label Feb 14, 2016
@mscdexmscdexforce-pushed the fix-readable-partial-decode branch from 873406b to 355b6c4CompareFebruary 14, 2016 17:28
@mscdex
Copy link
ContributorAuthor

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add a little comment here just to clarify why this is being introduced.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment added.

@mcollina
Copy link
Member

LGTM.

Just a quick check, any perf regression? That if (skipAdd) sits in a fairly hot path.

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
@mscdexmscdexforce-pushed the fix-readable-partial-decode branch from 355b6c4 to bbabbeeCompareFebruary 14, 2016 18:23
@mscdex
Copy link
ContributorAuthor

No idea about perf, there aren't any pure stream benchmarks at the moment.

@mcollina
Copy link
Member

The net ones support passing both buffers and utf8 encoded things, you should be able to get some data (with some noise)

@mscdex
Copy link
ContributorAuthor

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.

@mcollina
Copy link
Member

Agreed, LGTM.

@jasnell
Copy link
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 <[email protected]> Reviewed-By: James M Snell <[email protected]>
@mscdex
Copy link
ContributorAuthor

Landed in 9221201.

@mscdexmscdex closed this Feb 17, 2016
@mscdexmscdex deleted the fix-readable-partial-decode branch February 17, 2016 19:17
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 <[email protected]> Reviewed-By: James M Snell <[email protected]>
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 <[email protected]> Reviewed-By: James M Snell <[email protected]>
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 <[email protected]> Reviewed-By: James M Snell <[email protected]>
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 <[email protected]> Reviewed-By: James M Snell <[email protected]>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

streamIssues and PRs related to the stream subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@mscdex@mcollina@jasnell@MylesBorins