1
0
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:
verokarhu
2014-09-28 13:45:53 +03:00
parent 8382c797fc
commit 0beff4bb4a

View File

@ -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)