Compare commits

..

1 commit

Author SHA1 Message Date
7b91e998ea [#142] Fix multipart-objects download
All checks were successful
/ DCO (pull_request) Successful in 1m1s
/ Vulncheck (pull_request) Successful in 1m32s
/ Builds (pull_request) Successful in 55s
/ Lint (pull_request) Successful in 2m7s
/ Tests (pull_request) Successful in 1m8s
Signed-off-by: Nikita Zinkevich <n.zinkevich@yadro.com>
2024-10-15 15:50:41 +03:00

View file

@ -172,12 +172,15 @@ func findEndPart(cfg MultiObjectReaderConfig) (index int, length uint64) {
func (x *MultiObjectReader) Read(p []byte) (n int, err error) {
if x.curReader != nil {
n, err = x.curReader.Read(p)
if err != nil {
if err := x.curReader.Close(); err != nil {
return n, err
}
}
if !errors.Is(err, io.EOF) {
return n, err
}
if err = x.curReader.Close(); err != nil {
return n, err
}
x.curIndex++
}