]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Merge branch 'request-strategy-rewrite'
authorMatt Joiner <anacrolix@gmail.com>
Mon, 21 Jun 2021 02:04:06 +0000 (12:04 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Mon, 21 Jun 2021 02:04:06 +0000 (12:04 +1000)
1  2 
storage/interface.go
torrent.go

index 584338cb4ae178d30ab1c04ee138981cb41f7071,271bc7e60b92e2c2ba7c2734ccfd6941adc9db5a..a52ee6dca1cbc05e42033c164b56ca34515b28c2
@@@ -17,14 -17,15 +17,16 @@@ type ClientImpl interface 
  }
  
  // Data storage bound to a torrent.
- type TorrentImpl interface {
-       Piece(metainfo.Piece) PieceImpl
-       Close() error
+ type TorrentImpl struct {
+       Piece func(p metainfo.Piece) PieceImpl
+       Close func() error
+       // Storages that share the same value, will provide a pointer to the same function.
+       Capacity *func() *int64
  }
  
 -// Interacts with torrent piece data. Optional interfaces to implement include io.WriterTo, such as
 -// when a piece supports a more efficient way to write out incomplete chunks
 +// Interacts with torrent piece data. Optional interfaces to implement include:
 +//   io.WriterTo, such as when a piece supports a more efficient way to write out incomplete chunks.
 +//   SelfHashing, such as when a piece supports a more efficient way to hash its contents.
  type PieceImpl interface {
        // These interfaces are not as strict as normally required. They can
        // assume that the parameters are appropriate for the dimensions of the
diff --cc torrent.go
Simple merge