I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 6902a839 authored by zzz's avatar zzz
Browse files

* i2psnark: Fix rare IOOBE (ticket #777)

parent 4991c5a1
No related branches found
No related tags found
No related merge requests found
......@@ -356,22 +356,21 @@ class PeerState implements DataLoader
+ piece + "," + begin + "," + length + ") from "
+ peer);
int r = getFirstOutstandingRequest(piece);
// Unrequested piece number?
if (r == -1)
{
if (_log.shouldLog(Log.INFO))
_log.info("Unrequested 'piece: " + piece + ", "
+ begin + ", " + length + "' received from "
+ peer);
return null;
}
// Lookup the correct piece chunk request from the list.
Request req;
synchronized(this)
{
int r = getFirstOutstandingRequest(piece);
// Unrequested piece number?
if (r == -1) {
if (_log.shouldLog(Log.INFO))
_log.info("Unrequested 'piece: " + piece + ", "
+ begin + ", " + length + "' received from "
+ peer);
return null;
}
req = outstandingRequests.get(r);
while (req.getPiece() == piece && req.off != begin
&& r < outstandingRequests.size() - 1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment