]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Panic on bad piece per resource chunk names
authorMatt Joiner <anacrolix@gmail.com>
Sun, 11 Oct 2020 01:57:33 +0000 (12:57 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Sun, 11 Oct 2020 01:57:33 +0000 (12:57 +1100)
This was masking a bug in a coming sqlite storage implementation. Maybe it could be relaxed to checking for no filepath.Dir in the future.

storage/piece_resource.go

index 201d3f37fc382efe4e5c0d392d485837a65a59c5..86a081f24030d1c8ef3dc77a1c6524aa7c6d3b9c 100644 (file)
@@ -123,7 +123,7 @@ func (s piecePerResourcePiece) getChunks() (chunks chunks) {
        for _, n := range names {
                offset, err := strconv.ParseInt(n, 10, 64)
                if err != nil {
-                       continue
+                       panic(err)
                }
                i, err := s.rp.NewInstance(path.Join(s.incompleteDirPath(), n))
                if err != nil {