]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Uncomment the error handling in storage.boltDBPiece.ReadAt
authorMatt Joiner <anacrolix@gmail.com>
Wed, 31 Aug 2016 08:02:45 +0000 (18:02 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Wed, 31 Aug 2016 08:02:45 +0000 (18:02 +1000)
storage/boltdb.go

index 4a6928a52afdfd743e1dd8490415154f765dee47..a198f4888a332c8c964f694c5c848cc9795591de 100644 (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
 }