Browse Source

EOF handling

pull/2063/head
Chris Lu 4 years ago
parent
commit
ba77833343
  1. 3
      weed/filesys/dirty_pages_temp_interval.go

3
weed/filesys/dirty_pages_temp_interval.go

@ -255,6 +255,9 @@ func newFileSectionReader(tempfile *os.File, offset int64, dataOffset int64, siz
func (f *FileSectionReader) Read(p []byte) (n int, err error) {
dataLen := min(f.dataStop-f.Offset, int64(len(p)))
if dataLen < 0 {
return 0, io.EOF
}
glog.V(4).Infof("reading %v [%d,%d)", f.file.Name(), f.Offset, f.Offset+dataLen)
n, err = f.file.ReadAt(p[:dataLen], f.Offset)
if n > 0 {

Loading…
Cancel
Save