]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Don't close shared client piece completion in mmap storage v1.8.2
authorMatt Joiner <anacrolix@gmail.com>
Fri, 11 Oct 2019 06:37:22 +0000 (17:37 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Fri, 11 Oct 2019 06:37:22 +0000 (17:37 +1100)
Fixes #335.

storage/mmap.go

index 53d8680c5a098a77fb29ec7733a2fa6504d69658..f5437eed517265a2f162123f69fd7bcbe895edad 100644 (file)
@@ -47,7 +47,7 @@ func (s *mmapClientImpl) Close() error {
 type mmapTorrentStorage struct {
        infoHash metainfo.Hash
        span     *mmap_span.MMapSpan
-       pc       PieceCompletion
+       pc       PieceCompletionGetSetter
 }
 
 func (ts *mmapTorrentStorage) Piece(p metainfo.Piece) PieceImpl {
@@ -61,12 +61,11 @@ func (ts *mmapTorrentStorage) Piece(p metainfo.Piece) PieceImpl {
 }
 
 func (ts *mmapTorrentStorage) Close() error {
-       ts.pc.Close()
        return ts.span.Close()
 }
 
 type mmapStoragePiece struct {
-       pc PieceCompletion
+       pc PieceCompletionGetSetter
        p  metainfo.Piece
        ih metainfo.Hash
        io.ReaderAt