mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-25 23:21:54 +08:00
return the read bytes when EOF is reached
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user