Uncomment the error handling in storage.boltDBPiece.ReadAt

This commit is contained in:
Matt Joiner 2016-08-31 18:02:45 +10:00
parent 3c2db92a83
commit e51cb07f6e
1 changed files with 8 additions and 7 deletions

View File

@ -2,6 +2,7 @@ package storage
import (
"encoding/binary"
"io"
"path/filepath"
"github.com/boltdb/bolt"
@ -100,13 +101,13 @@ func (me *boltDBPiece) ReadAt(b []byte, off int64) (n int, err error) {
}
return nil
})
// if n == 0 && err == nil {
// if off < me.p.Length() {
// err = io.ErrUnexpectedEOF
// } else {
// err = io.EOF
// }
// }
if n == 0 && err == nil {
if off < me.p.Length() {
err = io.ErrUnexpectedEOF
} else {
err = io.EOF
}
}
// // log.Println(n, err)
return
}