Skip to content
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

Buffer.[set|write]Bytes doesn't return -1 after EOF #2395

Merged
merged 1 commit into from
Oct 13, 2022

Conversation

idelpivnitskiy
Copy link
Member

Motivation:

#2389 introduced a bug for Buffer.[set|write]Bytes methods that returns 0 instead of -1 after EOF.

Modifications:

  • Make sure we preserve -1 signal if nothing else was read from the InputStream;

Result:

Buffer.[set|write]Bytes correctly return -1 after EOF.

Motivation:

apple#2389 introduced a bug for `Buffer.[set|write]Bytes` methods that
returns `0` instead of `-1` after EOF.

Modifications:

- Make sure we preserve `-1` signal if nothing else was read from the
`InputStream`;

Result:

`Buffer.[set|write]Bytes` correctly return `-1` after EOF.
@idelpivnitskiy idelpivnitskiy self-assigned this Oct 13, 2022
@idelpivnitskiy idelpivnitskiy merged commit 01d075b into apple:main Oct 13, 2022
@idelpivnitskiy idelpivnitskiy deleted the fix branch October 13, 2022 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants