Author: toad
Date: 2008-04-02 23:45:02 +0000 (Wed, 02 Apr 2008)
New Revision: 18925
Modified:
trunk/freenet/src/freenet/support/RandomGrabArray.java
Log:
Fix losing queued blocks: We forgot to setParentGrabArray(null) in the
optimised path.
This particular bug was present since the coalescing changes went in.
Modified: trunk/freenet/src/freenet/support/RandomGrabArray.java
===================================================================
--- trunk/freenet/src/freenet/support/RandomGrabArray.java 2008-04-02
23:06:02 UTC (rev 18924)
+++ trunk/freenet/src/freenet/support/RandomGrabArray.java 2008-04-02
23:45:02 UTC (rev 18925)
@@ -107,6 +107,7 @@
reqs[chosenIndex] = reqs[index-1];
}
index--;
+
ret.setParentGrabArray(null);
}
if(logMINOR)
Logger.minor(this, "Chosen random item "+ret+" out of "+valid);
return ret;
@@ -127,6 +128,7 @@
}
index--;
if(logMINOR)
Logger.minor(this, "No valid or excluded items after removing "+ret);
+
ret.setParentGrabArray(null);
} else {
if(logMINOR)
Logger.minor(this, "No valid or excluded items apart from "+ret);
}