Skip to content
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.

Commit

Permalink
Ignore EOF error and actually reduce byte count
Browse files Browse the repository at this point in the history
  • Loading branch information
sinbad committed Nov 16, 2018
1 parent 1198b9e commit 44bdfd6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ func copyFileContents(size int64, src, dst *os.File, cb copyCallback) error {
nextBlock = bytesLeft
}
n, err := io.CopyN(dst, src, nextBlock)
if err != nil {
bytesLeft -= n
if err != nil && err != io.EOF {
return err
}
readSoFar := size - bytesLeft
Expand Down

0 comments on commit 44bdfd6

Please sign in to comment.