forked from premiere/premiere-libtorrent
made downloading pieces higher priority. fix in piece picker when blocks in prio 0 pieces were marked as finished
This commit is contained in:
parent
849db39472
commit
067219d14a
|
@ -285,8 +285,8 @@ namespace libtorrent
|
|||
int priority(int limit) const
|
||||
{
|
||||
if (filtered() || have()) return 0;
|
||||
// pieces we are currently downloading are prioritized
|
||||
int prio = downloading ? peer_count : peer_count * 2;
|
||||
// pieces we are currently downloading have high priority
|
||||
int prio = downloading ? 1 : peer_count * 2;
|
||||
// if the peer_count is 0 or 1, the priority cannot be higher
|
||||
if (prio <= 1) return prio;
|
||||
if (prio >= limit * 2) prio = limit * 2;
|
||||
|
|
|
@ -1240,6 +1240,7 @@ namespace libtorrent
|
|||
{
|
||||
p.downloading = 1;
|
||||
if (prio > 0) move(prio, p.index);
|
||||
else add(block.piece_index);
|
||||
|
||||
downloading_piece dp;
|
||||
dp.index = block.piece_index;
|
||||
|
|
Loading…
Reference in New Issue