From 9c73ecbf630d6fce123fd2a141aec2f2991a2280 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Mon, 9 Jul 2007 23:27:57 +0000 Subject: [PATCH] more assertion tests to tr_peerGotBlockFromUs() and tr_peerSentBlockToUs() to smoke out any remaining spurious ul/dl bytecounts --- libtransmission/peer.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libtransmission/peer.c b/libtransmission/peer.c index aba7ca741..98bb3fdce 100644 --- a/libtransmission/peer.c +++ b/libtransmission/peer.c @@ -828,6 +828,7 @@ tr_peerSentBlockToUs ( tr_peer_t * peer, int byteCount ) tr_torrent_t * tor = peer->tor; assert( byteCount >= 0 ); + assert( byteCount <= tor->info.pieceSize ); tor->downloadedCur += byteCount; tr_rcTransferred( peer->download, byteCount ); @@ -844,6 +845,7 @@ tr_peerGotBlockFromUs ( tr_peer_t * peer, int byteCount ) tr_torrent_t * tor = peer->tor; assert( byteCount >= 0 ); + assert( byteCount <= tor->info.pieceSize ); tor->uploadedCur += byteCount; tr_rcTransferred( peer->upload, byteCount );