(trunk libT) discard out-of-range reject messages from peers.

This commit is contained in:
Jordan Lee 2011-03-21 16:42:32 +00:00
parent bf4eb642dc
commit 41238c6c5d
1 changed files with 8 additions and 2 deletions

View File

@ -1671,9 +1671,15 @@ peerCallbackFunc( tr_peer * peer, const tr_peer_event * e, void * vt )
}
break;
case TR_PEER_CLIENT_GOT_REJ:
removeRequestFromTables( t, _tr_block( t->tor, e->pieceIndex, e->offset ), peer );
case TR_PEER_CLIENT_GOT_REJ: {
tr_block_index_t b = _tr_block( t->tor, e->pieceIndex, e->offset );
if( b < t->tor->blockCount )
removeRequestFromTables( t, b, peer );
else
tordbg( t, "Peer %s sent an out-of-range reject message",
tr_atomAddrStr( peer->atom ) );
break;
}
case TR_PEER_CLIENT_GOT_CHOKE:
peerDeclinedAllRequests( t, peer );