diff --git a/libtransmission/peer-msgs.c b/libtransmission/peer-msgs.c index 95c412b6a..17e98377d 100644 --- a/libtransmission/peer-msgs.c +++ b/libtransmission/peer-msgs.c @@ -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: