1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-25 09:13:06 +00:00

add more asserts up the call chain to find the source of pea_ and Gimp's bug

This commit is contained in:
Charles Kerr 2007-11-19 04:51:06 +00:00
parent a654f808e3
commit 3704854654

View file

@ -1047,6 +1047,7 @@ static int
readBtPiece( tr_peermsgs * msgs, struct evbuffer * inbuf, size_t inlen )
{
struct peer_request * req = &msgs->incoming.blockReq;
assert( EVBUFFER_LENGTH(inbuf) >= inlen );
dbgmsg( msgs, "In readBtPiece" );
if( !req->length )
@ -1068,6 +1069,7 @@ readBtPiece( tr_peermsgs * msgs, struct evbuffer * inbuf, size_t inlen )
const size_t nLeft = req->length - EVBUFFER_LENGTH(msgs->incoming.block);
size_t n = MIN( nLeft, inlen );
uint8_t * buf = tr_new( uint8_t, n );
assert( EVBUFFER_LENGTH(inbuf) >= n );
tr_peerIoReadBytes( msgs->io, inbuf, buf, n );
evbuffer_add( msgs->incoming.block, buf, n );
clientGotBytes( msgs, n );