mirror of
https://github.com/ipfs/kubo.git
synced 2026-03-09 18:28:08 +08:00
return the read bytes when EOF is reached
This commit is contained in:
parent
8382c797fc
commit
0beff4bb4a
@ -23,6 +23,9 @@ func (ss *SizeSplitter) Split(r io.Reader) chan []byte {
|
||||
nread, err := r.Read(chunk)
|
||||
if err != nil {
|
||||
if err == io.EOF {
|
||||
if nread > 0 {
|
||||
out <- chunk[:nread]
|
||||
}
|
||||
return
|
||||
}
|
||||
u.PErr("block split error: %v\n", err)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user