Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test to reproduce issue in
impl Stream for Entries
causing file…
…name truncation (#1) This is from edera-dev/tokio-tar#3 --- I tracked down this issue in astral-sh/uv#5450 (comment) > https://github.com/edera-dev/tokio-tar/blob/4ee357285b5053e6bfada7f117e530b4da94b74a/src/archive.rs#L317 > > ```rust > if is_recognized_header && entry.header().entry_type().is_pax_local_extensions() { > if self.pax_extensions.is_some() { > return Poll::Ready(Some(Err(other( > "two pax extensions entries describing \ > the same member", > )))); > } > let mut ef = EntryFields::from(entry); > let val = ready_err!(Pin::new(&mut ef).poll_read_all(cx)); > self.pax_extensions = Some(val); > continue; > } > ``` > > if `Pin::new(&mut ef).poll_read_all(cx)` is `Poll::Pending` then `ready_err!` returns it, so the Pax extension is lost. The same would apply to a pending poll that occurs while a > longlink or longname is being prepared. When `poll_next` is called again the next entry header is parsed. This PR demonstrates the issue by creating an AsyncRead impl which pends every second time it is polled. Commenting out [this line](https://github.com/RazerM/tokio-tar/blob/15466052f63c47cf47decd4409a9b0e936302773/tests/all.rs#L816) makes the test pass, because the reader doesn't enter a pending state in the "wrong" place. It is probably also the cause of dignifiedquire/async-tar#39
- Loading branch information