}
static void
-cancelAllRequestsToPeer( tr_peermsgs * msgs )
+cancelAllRequestsToPeer( tr_peermsgs * msgs, tr_bool sendCancel )
{
int i;
struct request_list a = msgs->clientWillAskFor;
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 );
dbgmsg( msgs, "got Choke" );
msgs->info->clientIsChoked = 1;
if( !fext )
- cancelAllRequestsToPeer( msgs );
- cancelAllRequestsToClient( msgs );
+ cancelAllRequestsToPeer( msgs, FALSE );
break;
case BT_UNCHOKE: