Don't move all the rest of peers if current peer is choked

Only move the last peer into place.
This commit is contained in:
Mukund Sivaraman 2008-08-22 16:30:02 +00:00
parent 75d2e74a64
commit 196ae72a85
1 changed files with 6 additions and 6 deletions

View File

@ -718,12 +718,12 @@ refillPulse( void * vtorrent )
const tr_addreq_t val = tr_peerMsgsAddRequest( peers[j]->msgs, piece );
switch( val )
{
case TR_ADDREQ_FULL:
case TR_ADDREQ_FULL:
case TR_ADDREQ_CLIENT_CHOKED:
memmove( peers+j, peers+j+1, sizeof(tr_peer*)*(--peerCount-j) );
memmove( peers+j, peers + --peerCount, sizeof *peers );
break;
case TR_ADDREQ_MISSING:
case TR_ADDREQ_DUPLICATE:
case TR_ADDREQ_MISSING:
case TR_ADDREQ_DUPLICATE:
++j;
break;
case TR_ADDREQ_OK:
@ -742,8 +742,8 @@ refillPulse( void * vtorrent )
const int val = tr_webseedAddRequest( webseeds[j], piece );
switch( val )
{
case TR_ADDREQ_FULL:
memmove( webseeds+j, webseeds+j+1, sizeof(tr_webseed*)*(--webseedCount-j) );
case TR_ADDREQ_FULL:
memmove( webseeds+j, webseeds + --webseedCount, sizeof *webseeds );
break;
case TR_ADDREQ_OK:
tr_bitfieldAdd( t->requestedPieces, piece );