From 6b546e8b4b2450a260c8f165241177a9e43edf2d Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sun, 7 Mar 2010 17:38:34 +0000 Subject: [PATCH] (trunk libT) #1242 "don't accept duplicate blocks during endgame" -- fixed in trunk for 1.92 --- libtransmission/peer-msgs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libtransmission/peer-msgs.c b/libtransmission/peer-msgs.c index d58fbebea..dda585d25 100644 --- a/libtransmission/peer-msgs.c +++ b/libtransmission/peer-msgs.c @@ -1603,13 +1603,16 @@ clientGotBlock( tr_peermsgs * msgs, return EMSGSIZE; } - /* save the block */ dbgmsg( msgs, "got block %u:%u->%u", req->index, req->offset, req->length ); if( !tr_peerMgrDidPeerRequest( msgs->torrent, msgs->peer, block ) ) { dbgmsg( msgs, "we didn't ask for this message..." ); return 0; } + if( tr_cpPieceIsComplete( &msgs->torrent->completion, req->index ) ) { + dbgmsg( msgs, "we did ask for this message, but the piece is already complete..." ); + return 0; + } /** *** Save the block