-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stream: why use string_decoder in Readable? #5223
Labels
confirmed-bug
Issues with confirmed bugs.
stream
Issues and PRs related to the stream subsystem.
string_decoder
Issues and PRs related to the string_decoder subsystem.
Comments
mscdex
added
question
Issues that look for answers.
stream
Issues and PRs related to the stream subsystem.
string_decoder
Issues and PRs related to the string_decoder subsystem.
labels
Feb 14, 2016
mscdex
added
confirmed-bug
Issues with confirmed bugs.
and removed
question
Issues that look for answers.
labels
Feb 14, 2016
mscdex
added a commit
to mscdex/io.js
that referenced
this issue
Feb 14, 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: nodejs#5223
rvagg
pushed a commit
that referenced
this issue
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 issue
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 issue
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 issue
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 free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
confirmed-bug
Issues with confirmed bugs.
stream
Issues and PRs related to the stream subsystem.
string_decoder
Issues and PRs related to the string_decoder subsystem.
I'm a little confused about the use of
string_decoder
in Readable (Line 140).I thought it was meant to support
push
ing incomplete UTF-8 character sequence, but the following example failed:No output.
I was expecting the output to be the same with
It seems that I have to
push
complete character sequence, or elsechunk
returned by the decoder in Line 140 will be empty (''
).If the stream is working in the flowing mode, every time
read()
try to get that empty string out,howMuchToRead
will return0
andfromList
is not called, and data stops flowing.Did I misunderstand the purpose of using
string_decoder
here?The text was updated successfully, but these errors were encountered: