forked from I2P_Developers/i2p.i2p
* i2psnark: Fix rare IOOBE (ticket #777)
This commit is contained in:
@ -356,11 +356,14 @@ class PeerState implements DataLoader
|
||||
+ piece + "," + begin + "," + length + ") from "
|
||||
+ peer);
|
||||
|
||||
// Lookup the correct piece chunk request from the list.
|
||||
Request req;
|
||||
synchronized(this)
|
||||
{
|
||||
int r = getFirstOutstandingRequest(piece);
|
||||
|
||||
// Unrequested piece number?
|
||||
if (r == -1)
|
||||
{
|
||||
if (r == -1) {
|
||||
if (_log.shouldLog(Log.INFO))
|
||||
_log.info("Unrequested 'piece: " + piece + ", "
|
||||
+ begin + ", " + length + "' received from "
|
||||
@ -368,10 +371,6 @@ class PeerState implements DataLoader
|
||||
return null;
|
||||
}
|
||||
|
||||
// Lookup the correct piece chunk request from the list.
|
||||
Request req;
|
||||
synchronized(this)
|
||||
{
|
||||
req = outstandingRequests.get(r);
|
||||
while (req.getPiece() == piece && req.off != begin
|
||||
&& r < outstandingRequests.size() - 1)
|
||||
|
Reference in New Issue
Block a user