Uncomment the error handling in storage.boltDBPiece.ReadAt
This commit is contained in:
parent
3c2db92a83
commit
e51cb07f6e
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue