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

fix: save in-progress data for interrupted reads #55

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

endbr64
Copy link

@endbr64 endbr64 commented Dec 24, 2024

Existing logic for poll_read_all() recreates the read buffer on reentry. When the read underneath returns Pending, the data that has already been read gets discarded.

This commit accumulates the data from every read inside of Entries.

Closes #39

Existing logic for `poll_read_all()` recreates the read buffer on
reentry. When the read underneath returns `Pending`, the data that has
already been read gets discarded.

This commit accumulates the data from every read inside of `Entries`.
charliermarsh added a commit to astral-sh/tokio-tar that referenced this pull request Feb 9, 2025
## Summary

Right now, if we hit a pending read while reading an entry, we end up
discarding the data rather than preserving it for the next poll (e.g.,
for a PAX extension). You can also see this reported at
dignifiedquire/async-tar#39.

This PR takes dignifiedquire/async-tar#55, but
applies an additional change as that PR didn't work on its own, in my
testing. Atop dignifiedquire/async-tar#55, we
also store the pending `Entry` to ensure that if we're pending, we don't
advance to the next entry on the next poll.

For more context, see: #1.
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.

Truncated paths when unarchiving
1 participant