You've already forked torrent-client
mirror of
https://github.com/veggiedefender/torrent-client.git
synced 2025-11-06 09:29:16 +02:00
Remove buffering from results channel
This commit is contained in:
@@ -187,7 +187,7 @@ func (t *Torrent) Download() ([]byte, error) {
|
|||||||
log.Println("Starting download for", t.Name)
|
log.Println("Starting download for", t.Name)
|
||||||
// Init queues for workers to retrieve work and send results
|
// Init queues for workers to retrieve work and send results
|
||||||
workQueue := make(chan *pieceWork, len(t.PieceHashes))
|
workQueue := make(chan *pieceWork, len(t.PieceHashes))
|
||||||
results := make(chan *pieceResult, len(t.PieceHashes))
|
results := make(chan *pieceResult)
|
||||||
for index, hash := range t.PieceHashes {
|
for index, hash := range t.PieceHashes {
|
||||||
length := t.calculatePieceSize(index)
|
length := t.calculatePieceSize(index)
|
||||||
workQueue <- &pieceWork{index, hash, length}
|
workQueue <- &pieceWork{index, hash, length}
|
||||||
|
|||||||
Reference in New Issue
Block a user