r.responsive = true
}
+// Disable responsive mode.
+func (r *Reader) SetNonResponsive() {
+ r.responsive = false
+}
+
// Configure the number of bytes ahead of a read that should also be
// prioritized in preparation for further reads.
func (r *Reader) SetReadahead(readahead int64) {
r.posChanged()
}
+// Return reader's current position.
+func (r *Reader) CurrentPos() int64 {
+ return r.pos
+}
+
func (r *Reader) readable(off int64) (ret bool) {
if r.t.closed.IsSet() {
return true
return t.numPieces()
}
+// Get missing bytes count for specific piece.
+func (t *Torrent) PieceBytesMissing(piece int) int64 {
+ t.cl.mu.Lock()
+ defer t.cl.mu.Unlock()
+
+ return int64(t.pieces[piece].bytesLeft())
+}
+
// Drop the torrent from the client, and close it. It's always safe to do
// this. No data corruption can, or should occur to either the torrent's data,
// or connected peers.