return
}
cl.raisePiecePriority(t, index, piecePriorityNext)
- for i := 0; i < t.numConnsUnchoked()-2; i++ {
+ for i := 0; i < 3; i++ {
index++
if index >= t.numPieces() {
break
// priority pieces.
switch priority {
case piecePriorityReadahead:
- key -= len(cn.piecePriorities) / 3
+ key -= len(cn.piecePriorities)
case piecePriorityNext:
- key -= len(cn.piecePriorities) / 2
+ key -= 2 * len(cn.piecePriorities)
case piecePriorityNow:
- key -= len(cn.piecePriorities)
+ key -= 3 * len(cn.piecePriorities)
}
// Favour earlier pieces more than later pieces.
- key -= piece / 2
+ // key -= piece / 2
+
cn.pieceRequestOrder.SetPiece(piece, key)
}