(libT) #1562: 1.40 sends unnecessary `cancel' messages when choked

This commit is contained in:
Charles Kerr 2008-12-05 01:12:55 +00:00
parent 8d459f06b9
commit eb90a55608
1 changed files with 4 additions and 4 deletions

View File

@ -1012,7 +1012,7 @@ tr_peerMsgsAddRequest( tr_peermsgs * msgs,
}
static void
cancelAllRequestsToPeer( tr_peermsgs * msgs )
cancelAllRequestsToPeer( tr_peermsgs * msgs, tr_bool sendCancel )
{
int i;
struct request_list a = msgs->clientWillAskFor;
@ -1027,7 +1027,8 @@ cancelAllRequestsToPeer( tr_peermsgs * msgs )
for( i = 0; i < b.count; ++i ) {
fireCancelledReq( msgs, &b.requests[i] );
protocolSendCancel( msgs, &b.requests[i] );
if( sendCancel )
protocolSendCancel( msgs, &b.requests[i] );
}
reqListClear( &a );
@ -1473,8 +1474,7 @@ readBtMessage( tr_peermsgs * msgs,
dbgmsg( msgs, "got Choke" );
msgs->info->clientIsChoked = 1;
if( !fext )
cancelAllRequestsToPeer( msgs );
cancelAllRequestsToClient( msgs );
cancelAllRequestsToPeer( msgs, FALSE );
break;
case BT_UNCHOKE: