forked from I2P_Developers/i2p.i2p
i2psnark: Fix IOOBE when stopping torrent that is allocating (ticket #2273)
more sync in PartialPiece
This commit is contained in:
@@ -52,6 +52,25 @@ class Request
|
||||
throw new IndexOutOfBoundsException("Illegal Request " + toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* Dummy Request for PeerState.returnPartialPieces().
|
||||
* len will be zero.
|
||||
*
|
||||
* @param piece Piece number requested.
|
||||
* @param off the offset in the array.
|
||||
* @since 0.9.36
|
||||
*/
|
||||
Request(PartialPiece piece, int off)
|
||||
{
|
||||
this.piece = piece;
|
||||
this.off = off;
|
||||
this.len = 0;
|
||||
|
||||
// Sanity check
|
||||
if (off < 0 || off > piece.getLength())
|
||||
throw new IndexOutOfBoundsException("Illegal Request " + toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 0.9.1
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user