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

Use first nonempty buffer in vectored I/O #1998

Merged
merged 1 commit into from
Dec 10, 2019
Merged

Use first nonempty buffer in vectored I/O #1998

merged 1 commit into from
Dec 10, 2019

Conversation

tmiasko
Copy link
Contributor

@tmiasko tmiasko commented Dec 7, 2019

Previous implementation would use the first buffer even when it was
empty and other nonempty buffers are provided. This could result in
Ok(0) return value which has otherwise a special meaning. The new
implementation uses the first nonempty buffer instead to avoid the
issue.

Previous implementation would return early if no buffers are provided.
The new implementation delegates operation using an empty buffer. This
gives an implementation an ability to decide how an empty read / write
operation should behave.

This change aligns the implementation with synchronous version of those
traits.

Previous implementation would use the first buffer even when it was
empty and other nonempty buffers are provided. This could result in
`Ok(0)` return value which has otherwise a special meaning. The new
implementation uses the first nonempty buffer instead to avoid the
issue.

Previous implementation would return early if no buffers are provided.
The new implementation delegates operation using an empty buffer. This
gives an implementation an ability to decide how an empty read / write
operation should behave.

This change aligns the implementation with synchronous version of those
traits.
@cramertj
Copy link
Member

Thanks!

@cramertj cramertj merged commit 06098e4 into rust-lang:master Dec 10, 2019
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