Skip to content

Fix incorrect io::Take's limit resulting from io::copy specialization #79650

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

Merged
merged 2 commits into from
Dec 6, 2020

Conversation

the8472
Copy link
Member

@the8472 the8472 commented Dec 2, 2020

The specialization introduced in #75272 fails to update io::Take wrappers after performing the copy syscalls which bypass those wrappers. The buffer flushing before the copy does update them correctly, but the bytes copied after the initial flush weren't subtracted.

The fix is to subtract the bytes copied from each Take in the chain of wrappers, even when an error occurs during the syscall loop. To do so the CopyResult enum now has to carry the bytes copied so far in the error case.

@rust-highfive
Copy link
Contributor

r? @dtolnay

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 2, 2020
@dtolnay
Copy link
Member

dtolnay commented Dec 5, 2020

@bors r+

@bors
Copy link
Collaborator

bors commented Dec 5, 2020

📌 Commit a9b1381 has been approved by dtolnay

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 5, 2020
@bors
Copy link
Collaborator

bors commented Dec 6, 2020

⌛ Testing commit a9b1381 with merge ddafcc0...

@bors
Copy link
Collaborator

bors commented Dec 6, 2020

☀️ Test successful - checks-actions
Approved by: dtolnay
Pushing ddafcc0 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 6, 2020
@bors bors merged commit ddafcc0 into rust-lang:master Dec 6, 2020
@rustbot rustbot added this to the 1.50.0 milestone Dec 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants