From fd7c112151c477cf3ecc6546502faface099309e Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 25 Jul 2007 18:30:00 +0000 Subject: [PATCH] fix endgame bug reported again and again and again by SoftwareElves ;) --- libtransmission/peer.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libtransmission/peer.c b/libtransmission/peer.c index bca1ce346..e4151025b 100644 --- a/libtransmission/peer.c +++ b/libtransmission/peer.c @@ -693,7 +693,7 @@ writeEnd: const int n = TR_BLOCKS_IN_PIECE( tor, piece ); const int end = firstBlock + n; int block; - for( block=firstBlock; block0 && blockcompletion, block )) @@ -716,6 +716,9 @@ writeEnd: tr_free( pool ); } + assert( peer->inRequestCount <= peer->inRequestMax ); + assert( peer->inRequestMax <= peer->inRequestAlloc ); + return TR_OK; }