mirror of
https://github.com/transmission/transmission
synced 2025-02-24 07:00:40 +00:00
(libT) #1562: 1.40 sends unnecessary `cancel' messages when choked
This commit is contained in:
parent
8d459f06b9
commit
eb90a55608
1 changed files with 4 additions and 4 deletions
|
@ -1012,7 +1012,7 @@ tr_peerMsgsAddRequest( tr_peermsgs * msgs,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
cancelAllRequestsToPeer( tr_peermsgs * msgs )
|
cancelAllRequestsToPeer( tr_peermsgs * msgs, tr_bool sendCancel )
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
struct request_list a = msgs->clientWillAskFor;
|
struct request_list a = msgs->clientWillAskFor;
|
||||||
|
@ -1027,6 +1027,7 @@ cancelAllRequestsToPeer( tr_peermsgs * msgs )
|
||||||
|
|
||||||
for( i = 0; i < b.count; ++i ) {
|
for( i = 0; i < b.count; ++i ) {
|
||||||
fireCancelledReq( msgs, &b.requests[i] );
|
fireCancelledReq( msgs, &b.requests[i] );
|
||||||
|
if( sendCancel )
|
||||||
protocolSendCancel( msgs, &b.requests[i] );
|
protocolSendCancel( msgs, &b.requests[i] );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1473,8 +1474,7 @@ readBtMessage( tr_peermsgs * msgs,
|
||||||
dbgmsg( msgs, "got Choke" );
|
dbgmsg( msgs, "got Choke" );
|
||||||
msgs->info->clientIsChoked = 1;
|
msgs->info->clientIsChoked = 1;
|
||||||
if( !fext )
|
if( !fext )
|
||||||
cancelAllRequestsToPeer( msgs );
|
cancelAllRequestsToPeer( msgs, FALSE );
|
||||||
cancelAllRequestsToClient( msgs );
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BT_UNCHOKE:
|
case BT_UNCHOKE:
|
||||||
|
|
Loading…
Reference in a new issue