package torrent
import (
- requestStrategy "github.com/anacrolix/torrent/request-strategy"
+ requestStrategy "github.com/anacrolix/torrent/internal/request-strategy"
"github.com/anacrolix/torrent/storage"
)
g "github.com/anacrolix/generics"
list "github.com/bahlo/generic-list-go"
- "github.com/anacrolix/torrent/typed-roaring"
+ typedRoaring "github.com/anacrolix/torrent/typed-roaring"
)
type orderedBitmap[T typedRoaring.BitConstraint] struct {
"github.com/anacrolix/multiless"
"github.com/anacrolix/torrent/internal/alloclim"
+ requestStrategy "github.com/anacrolix/torrent/internal/request-strategy"
"github.com/anacrolix/torrent/mse"
pp "github.com/anacrolix/torrent/peer_protocol"
- request_strategy "github.com/anacrolix/torrent/request-strategy"
typedRoaring "github.com/anacrolix/torrent/typed-roaring"
)
// Stuff controlled by the local peer.
needRequestUpdate updateRequestReason
// TODO: How are pending cancels handled for webseed peers?
- requestState request_strategy.PeerRequestState
+ requestState requestStrategy.PeerRequestState
updateRequestsTimer *time.Timer
lastRequestUpdate time.Time
peakRequests maxRequests
count = 1
}
}
- cn.requestState.Requests.Iterate(func(requestIndex request_strategy.RequestIndex) bool {
+ cn.requestState.Requests.Iterate(func(requestIndex requestStrategy.RequestIndex) bool {
next(Some(cn.t.pieceIndexOfRequestIndex(requestIndex)))
return true
})
import (
g "github.com/anacrolix/generics"
+ requestStrategy "github.com/anacrolix/torrent/internal/request-strategy"
"github.com/anacrolix/torrent/metainfo"
- request_strategy "github.com/anacrolix/torrent/request-strategy"
"github.com/anacrolix/torrent/storage"
)
capFunc storage.TorrentCapacity
}
-func (r requestStrategyInputMultiTorrent) Torrent(ih metainfo.Hash) request_strategy.Torrent {
+func (r requestStrategyInputMultiTorrent) Torrent(ih metainfo.Hash) requestStrategy.Torrent {
return requestStrategyTorrent{g.MapMustGet(r.torrents, ih)}
}
t *Torrent
}
-func (r requestStrategyInputSingleTorrent) Torrent(_ metainfo.Hash) request_strategy.Torrent {
+func (r requestStrategyInputSingleTorrent) Torrent(_ metainfo.Hash) requestStrategy.Torrent {
return requestStrategyTorrent{r.t}
}
return 0, false
}
-var _ request_strategy.Input = requestStrategyInputSingleTorrent{}
+var _ requestStrategy.Input = requestStrategyInputSingleTorrent{}
// getRequestStrategyInputCommon returns request strategy Input implementation common to all inputs.
func (cl *Client) getRequestStrategyInputCommon() requestStrategyInputCommon {
return requestStrategyInputCommon{cl.config.MaxUnverifiedBytes}
}
-func (t *Torrent) getRequestStrategyInput() request_strategy.Input {
+func (t *Torrent) getRequestStrategyInput() requestStrategy.Input {
return t.clientPieceRequestOrderKey().getRequestStrategyInput(t.cl)
}
t *Torrent
}
-func (r requestStrategyTorrent) Piece(i int) request_strategy.Piece {
+func (r requestStrategyTorrent) Piece(i int) requestStrategy.Piece {
return requestStrategyPiece{r.t.piece(i)}
}
return r.t.info.PieceLength
}
-var _ request_strategy.Torrent = requestStrategyTorrent{}
+var _ requestStrategy.Torrent = requestStrategyTorrent{}
type requestStrategyPiece struct {
p *Piece
return !r.p.ignoreForRequests() && r.p.purePriority() != PiecePriorityNone
}
-var _ request_strategy.Piece = requestStrategyPiece{}
+var _ requestStrategy.Piece = requestStrategyPiece{}
g "github.com/anacrolix/generics"
"github.com/anacrolix/missinggo/v2/iter"
"github.com/davecgh/go-spew/spew"
- qt "github.com/go-quicktest/qt"
+ "github.com/go-quicktest/qt"
+ requestStrategy "github.com/anacrolix/torrent/internal/request-strategy"
"github.com/anacrolix/torrent/metainfo"
- request_strategy "github.com/anacrolix/torrent/request-strategy"
"github.com/anacrolix/torrent/storage"
infohash_v2 "github.com/anacrolix/torrent/types/infohash-v2"
)
-func makeRequestStrategyPiece(t request_strategy.Torrent) request_strategy.Piece {
+func makeRequestStrategyPiece(t requestStrategy.Torrent) requestStrategy.Piece {
return t.Piece(0)
}
"github.com/anacrolix/log"
"github.com/anacrolix/multiless"
+ requestStrategy "github.com/anacrolix/torrent/internal/request-strategy"
"github.com/anacrolix/torrent/metainfo"
- requestStrategy "github.com/anacrolix/torrent/request-strategy"
typedRoaring "github.com/anacrolix/torrent/typed-roaring"
)
package torrent
-import (
- "github.com/anacrolix/torrent/typed-roaring"
-)
+import typedRoaring "github.com/anacrolix/torrent/typed-roaring"
// Return the number of bits set in the range. To do this we need the rank of the item before the
// first, and the rank of the last item. An off-by-one minefield. Hopefully I haven't missed
"path/filepath"
"sync"
- "github.com/go-llsqlite/adapter"
+ sqlite "github.com/go-llsqlite/adapter"
"github.com/go-llsqlite/adapter/sqlitex"
"github.com/anacrolix/torrent/metainfo"
package webseed_partial_seed
import (
- "github.com/anacrolix/torrent"
- "github.com/anacrolix/torrent/internal/testutil"
- qt "github.com/go-quicktest/qt"
"path/filepath"
"runtime"
"testing"
"time"
+
+ "github.com/anacrolix/torrent"
+ "github.com/anacrolix/torrent/internal/testutil"
+ qt "github.com/go-quicktest/qt"
)
func testSrcDir() string {
import (
g "github.com/anacrolix/generics"
- request_strategy "github.com/anacrolix/torrent/request-strategy"
+ requestStrategy "github.com/anacrolix/torrent/internal/request-strategy"
)
// It's probably possible to track whether the piece moves around in the btree to be more efficient
cpro := t.cl.pieceRequestOrder
if _, ok := cpro[key]; !ok {
value := clientPieceRequestOrderValue{
- pieces: request_strategy.NewPieceOrder(request_strategy.NewAjwernerBtree(), t.numPieces()),
+ pieces: requestStrategy.NewPieceOrder(requestStrategy.NewAjwernerBtree(), t.numPieces()),
}
g.MakeMap(&value.torrents)
cpro[key] = value
}
}
-func (t *Torrent) getPieceRequestOrder() *request_strategy.PieceRequestOrder {
+func (t *Torrent) getPieceRequestOrder() *requestStrategy.PieceRequestOrder {
if t.storage == nil {
return nil
}
"github.com/anacrolix/torrent/bencode"
"github.com/anacrolix/torrent/internal/check"
"github.com/anacrolix/torrent/internal/nestedmaps"
+ request_strategy "github.com/anacrolix/torrent/internal/request-strategy"
"github.com/anacrolix/torrent/merkle"
"github.com/anacrolix/torrent/metainfo"
pp "github.com/anacrolix/torrent/peer_protocol"
utHolepunch "github.com/anacrolix/torrent/peer_protocol/ut-holepunch"
- request_strategy "github.com/anacrolix/torrent/request-strategy"
"github.com/anacrolix/torrent/storage"
"github.com/anacrolix/torrent/tracker"
typedRoaring "github.com/anacrolix/torrent/typed-roaring"
import (
"unique"
+ requestStrategy2 "github.com/anacrolix/torrent/internal/request-strategy"
"github.com/anacrolix/torrent/metainfo"
- requestStrategy "github.com/anacrolix/torrent/request-strategy"
)
type (
func (cl *Client) abandonedUpdateWebSeedRequests() {
for key, value := range cl.pieceRequestOrder {
input := key.getRequestStrategyInput(cl)
- requestStrategy.GetRequestablePieces(
+ requestStrategy2.GetRequestablePieces(
input,
value.pieces,
- func(ih metainfo.Hash, pieceIndex int, orderState requestStrategy.PieceRequestOrderState) bool {
+ func(ih metainfo.Hash, pieceIndex int, orderState requestStrategy2.PieceRequestOrderState) bool {
return true
},
)