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

implement write_vectored for DuplexStream #5985

Merged
merged 1 commit into from
Sep 8, 2023

Conversation

maminrayej
Copy link
Member

The poll_write_vectored function for DuplexStream currently uses the default implementation in AsyncWrite, which only writes the first non-empty buffer in bufs. This PR adds proper vectored write support for DuplexStream.

Motivation

Solution

Instead of only copying the first non-empty buffer, this implementation tries to fill all available space in the internal buffer.

Resolves Issue #5983.

@Darksonn Darksonn added A-tokio Area: The main tokio crate M-io Module: tokio/io labels Sep 8, 2023
Copy link
Contributor

@Darksonn Darksonn left a comment

Choose a reason for hiding this comment

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

Thanks. Looks good to me.

@Darksonn Darksonn merged commit 9fafe78 into tokio-rs:master Sep 8, 2023
75 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate M-io Module: tokio/io
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants