return t.Info.TotalLength() - t.bytesLeft()
}
-func (t Torrent) NumPieces() int {
- return t.numPieces()
-}
-
-func (t Torrent) Drop() {
- t.cl.mu.Lock()
- t.cl.dropTorrent(t.InfoHash)
- t.cl.mu.Unlock()
-}
-
// A file-like handle to some torrent data resource.
type Handle interface {
io.Reader
defer t.stateMu.Unlock()
return t.torrent.pieceStateRuns()
}
+
+func (t Torrent) NumPieces() int {
+ return t.numPieces()
+}
+
+func (t Torrent) Drop() {
+ t.cl.mu.Lock()
+ t.cl.dropTorrent(t.InfoHash)
+ t.cl.mu.Unlock()
+}