Author: toad
Date: 2005-11-25 18:57:21 +0000 (Fri, 25 Nov 2005)
New Revision: 7607
Modified:
trunk/freenet/src/freenet/client/RetryTracker.java
trunk/freenet/src/freenet/node/Version.java
Log:
226:
Fix calling decode while holding RetryTracker lock !
Modified: trunk/freenet/src/freenet/client/RetryTracker.java
===================================================================
--- trunk/freenet/src/freenet/client/RetryTracker.java 2005-11-25 18:49:34 UTC
(rev 7606)
+++ trunk/freenet/src/freenet/client/RetryTracker.java 2005-11-25 18:57:21 UTC
(rev 7607)
@@ -213,7 +213,9 @@
* If we can start some blocks, start some blocks.
* Otherwise if we are finished, call the callback's finish method.
*/
- public synchronized void maybeStart(boolean cantCallFinished) {
+ public void maybeStart(boolean cantCallFinished) {
+ boolean callFinished = false;
+ synchronized(this) {
if(killed) return;
Logger.minor(this, "succeeded: "+succeededBlocks.size()+",
target: "+targetSuccesses+
", failed:
"+failedBlocksTooManyRetries.size()+", fatal: "+failedBlocksFatalErrors.size()+
@@ -236,7 +238,7 @@
}
runningBlocks.clear();
if(!cantCallFinished)
- callback.finished(succeededBlocks(),
failedBlocks(), fatalErrorBlocks());
+ callFinished = true;
else {
Runnable r = new Runnable() { public void run()
{ callback.finished(succeededBlocks(), failedBlocks(), fatalErrorBlocks()); } };
Thread t = new Thread(r);
@@ -252,6 +254,9 @@
runningBlocks.add(block);
}
}
+ }
+ if(callFinished)
+ callback.finished(succeededBlocks(), failedBlocks(),
fatalErrorBlocks());
}
public void success(SplitfileBlock block) {
Modified: trunk/freenet/src/freenet/node/Version.java
===================================================================
--- trunk/freenet/src/freenet/node/Version.java 2005-11-25 18:49:34 UTC (rev
7606)
+++ trunk/freenet/src/freenet/node/Version.java 2005-11-25 18:57:21 UTC (rev
7607)
@@ -20,10 +20,10 @@
public static final String protocolVersion = "1.0";
/** The build number of the current revision */
- public static final int buildNumber = 225;
+ public static final int buildNumber = 226;
/** Oldest build of Fred we will talk to */
- public static final int lastGoodBuild = 225;
+ public static final int lastGoodBuild = 226;
/** The highest reported build of fred */
public static int highestSeenBuild = buildNumber;