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

io: CopyBuffer should keep reading when there's space in the buffer #3719

Closed
wants to merge 0 commits into from

Conversation

cssivision
Copy link
Contributor

try to fix #3694

@Darksonn Darksonn added A-tokio Area: The main tokio crate M-io Module: tokio/io labels Apr 22, 2021
@cssivision cssivision closed this Apr 22, 2021
@cssivision cssivision reopened this Apr 23, 2021
tokio/src/io/util/copy.rs Outdated Show resolved Hide resolved
@Darksonn
Copy link
Contributor

As I see it, ignoring what happens when the reader returns EOF, the loop should keep going until the following condition is satisfied:

(reader has returned Pending or buf is full) and (writer has returned Pending or buf is empty)

Furthermore, if either IO resource has returned Pending, then we should not poll that resource again during this poll.

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.

Keep reading when there's space in the buffer for tokio::io::copy
2 participants