Fixes a race condition
This commit is contained in:
parent
706a2ade11
commit
6ab640c50b
|
@ -95,6 +95,12 @@ static uint8_t * blockPending( tr_torrent_t * tor, tr_peer_t * peer,
|
||||||
|
|
||||||
tr_ioRead( tor->io, r->index, r->begin, r->length, &p[13] );
|
tr_ioRead( tor->io, r->index, r->begin, r->length, &p[13] );
|
||||||
|
|
||||||
|
if( peer->outRequestCount < 1 )
|
||||||
|
{
|
||||||
|
/* We were choked during the read */
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
peer_dbg( "SEND piece %d/%d (%d bytes)",
|
peer_dbg( "SEND piece %d/%d (%d bytes)",
|
||||||
r->index, r->begin, r->length );
|
r->index, r->begin, r->length );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue