diff --git a/request-strategy/ajwerner-btree.go b/request-strategy/ajwerner-btree.go index 209f62dc..183e2b92 100644 --- a/request-strategy/ajwerner-btree.go +++ b/request-strategy/ajwerner-btree.go @@ -1,4 +1,4 @@ -package request_strategy +package requestStrategy import ( "github.com/ajwerner/btree" diff --git a/request-strategy/order.go b/request-strategy/order.go index f6080831..df656f6d 100644 --- a/request-strategy/order.go +++ b/request-strategy/order.go @@ -1,4 +1,4 @@ -package request_strategy +package requestStrategy import ( "bytes" diff --git a/request-strategy/peer.go b/request-strategy/peer.go index cbdb2b75..4176188c 100644 --- a/request-strategy/peer.go +++ b/request-strategy/peer.go @@ -1,7 +1,7 @@ -package request_strategy +package requestStrategy import ( - "github.com/anacrolix/torrent/typed-roaring" + typedRoaring "github.com/anacrolix/torrent/typed-roaring" ) type PeerRequestState struct { diff --git a/request-strategy/piece-request-order.go b/request-strategy/piece-request-order.go index 5238a3a1..3056741d 100644 --- a/request-strategy/piece-request-order.go +++ b/request-strategy/piece-request-order.go @@ -1,4 +1,4 @@ -package request_strategy +package requestStrategy import "github.com/anacrolix/torrent/metainfo" diff --git a/request-strategy/piece-request-order_test.go b/request-strategy/piece-request-order_test.go index 35c97c2d..ee5fb39a 100644 --- a/request-strategy/piece-request-order_test.go +++ b/request-strategy/piece-request-order_test.go @@ -1,4 +1,4 @@ -package request_strategy +package requestStrategy import ( "testing" diff --git a/request-strategy/piece.go b/request-strategy/piece.go index 626cc75b..b858dfff 100644 --- a/request-strategy/piece.go +++ b/request-strategy/piece.go @@ -1,4 +1,4 @@ -package request_strategy +package requestStrategy type ChunksIterFunc func(func(ChunkIndex)) diff --git a/request-strategy/tidwall-btree.go b/request-strategy/tidwall-btree.go index 6b84dc05..f7eabcdc 100644 --- a/request-strategy/tidwall-btree.go +++ b/request-strategy/tidwall-btree.go @@ -1,4 +1,4 @@ -package request_strategy +package requestStrategy import ( "github.com/tidwall/btree" diff --git a/request-strategy/torrent.go b/request-strategy/torrent.go index 591ac363..5bc438ee 100644 --- a/request-strategy/torrent.go +++ b/request-strategy/torrent.go @@ -1,4 +1,4 @@ -package request_strategy +package requestStrategy type Torrent interface { IgnorePiece(int) bool diff --git a/requesting.go b/requesting.go index 60e56df7..7fbfccfb 100644 --- a/requesting.go +++ b/requesting.go @@ -13,8 +13,8 @@ import ( "github.com/anacrolix/multiless" "github.com/lispad/go-generics-tools/binheap" - "github.com/anacrolix/torrent/request-strategy" - "github.com/anacrolix/torrent/typed-roaring" + requestStrategy "github.com/anacrolix/torrent/request-strategy" + typedRoaring "github.com/anacrolix/torrent/typed-roaring" ) type ( @@ -23,8 +23,8 @@ type ( maxRequests = int ) -func (t *Torrent) requestStrategyPieceOrderState(i int) request_strategy.PieceRequestOrderState { - return request_strategy.PieceRequestOrderState{ +func (t *Torrent) requestStrategyPieceOrderState(i int) requestStrategy.PieceRequestOrderState { + return requestStrategy.PieceRequestOrderState{ Priority: t.piece(i).purePriority(), Partial: t.piecePartiallyDownloaded(i), Availability: t.piece(i).availability(), @@ -70,14 +70,14 @@ func (p *peerId) GobDecode(b []byte) error { } type ( - RequestIndex = request_strategy.RequestIndex - chunkIndexType = request_strategy.ChunkIndex + RequestIndex = requestStrategy.RequestIndex + chunkIndexType = requestStrategy.ChunkIndex ) type desiredPeerRequests struct { requestIndexes []RequestIndex peer *Peer - pieceStates []request_strategy.PieceRequestOrderState + pieceStates []requestStrategy.PieceRequestOrderState } func (p *desiredPeerRequests) Len() int { @@ -204,10 +204,10 @@ func (p *Peer) getDesiredRequestState() (desired desiredRequestState) { } // Caller-provided allocation for roaring bitmap iteration. var it typedRoaring.Iterator[RequestIndex] - request_strategy.GetRequestablePieces( + requestStrategy.GetRequestablePieces( input, t.getPieceRequestOrder(), - func(ih InfoHash, pieceIndex int, pieceExtra request_strategy.PieceRequestOrderState) { + func(ih InfoHash, pieceIndex int, pieceExtra requestStrategy.PieceRequestOrderState) { if ih != t.infoHash { return } @@ -216,7 +216,7 @@ func (p *Peer) getDesiredRequestState() (desired desiredRequestState) { } requestHeap.pieceStates[pieceIndex] = pieceExtra allowedFast := p.peerAllowedFast.Contains(pieceIndex) - t.iterUndirtiedRequestIndexesInPiece(&it, pieceIndex, func(r request_strategy.RequestIndex) { + t.iterUndirtiedRequestIndexesInPiece(&it, pieceIndex, func(r requestStrategy.RequestIndex) { if !allowedFast { // We must signal interest to request this. TODO: We could set interested if the // peers pieces (minus the allowed fast set) overlap with our missing pieces if