fix endgame bug reported again and again and again by SoftwareElves ;)
This commit is contained in:
parent
d84c2bd44a
commit
fd7c112151
|
@ -693,7 +693,7 @@ writeEnd:
|
|||
const int n = TR_BLOCKS_IN_PIECE( tor, piece );
|
||||
const int end = firstBlock + n;
|
||||
int block;
|
||||
for( block=firstBlock; block<end; ++block )
|
||||
for( block=firstBlock; openSlots>0 && block<end; ++block )
|
||||
{
|
||||
/* don't ask for it if we've already got it */
|
||||
if( tr_cpBlockIsComplete( tor->completion, block ))
|
||||
|
@ -716,6 +716,9 @@ writeEnd:
|
|||
tr_free( pool );
|
||||
}
|
||||
|
||||
assert( peer->inRequestCount <= peer->inRequestMax );
|
||||
assert( peer->inRequestMax <= peer->inRequestAlloc );
|
||||
|
||||
return TR_OK;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue