This repository has been archived by the owner on Mar 29, 2023. It is now read-only.
Multipart iterator consumes its internal reader #53
Labels
kind/bug
A bug in existing code (including security flaws)
need/triage
Needs initial labeling and prioritization
multipartDirectory
iteratorEntries()
directly access its internal state (instead of creating its own)go-ipfs-files/multipartfile.go
Lines 218 to 220 in 88b4692
and consumes from the directory's internal
multipart.Reader
go-ipfs-files/multipartfile.go
Lines 167 to 169 in 88b4692
hence we can only iterate the directory once.
This is not the expected behavior of a directory iterator. That said, in practice we normally iterate inputs once in
go-ipfs
, and I'm targeting an exception for ipfs/kubo#8927. Acknowledging this is not a serious bug my question then would be: which path to choose from?a. Leave it be and create a special case for this directory type downstream.
b. Attempt to fix this, if possible without adding much more complexity. (I'd want to avoid copying everything to our own buffer and iterating that.)
The text was updated successfully, but these errors were encountered: