Author: toad
Date: 2006-03-25 17:12:02 +0000 (Sat, 25 Mar 2006)
New Revision: 8314
Modified:
trunk/freenet/src/freenet/client/async/BaseSingleFileFetcher.java
trunk/freenet/src/freenet/client/async/SingleBlockInserter.java
trunk/freenet/src/freenet/node/Version.java
Log:
573:
maxRetries=0 => try it ONCE, not twice. maxRetries+1 attempts total.
We were doing maxRetries+2 tries.
Modified: trunk/freenet/src/freenet/client/async/BaseSingleFileFetcher.java
===================================================================
--- trunk/freenet/src/freenet/client/async/BaseSingleFileFetcher.java
2006-03-25 16:56:53 UTC (rev 8313)
+++ trunk/freenet/src/freenet/client/async/BaseSingleFileFetcher.java
2006-03-25 17:12:02 UTC (rev 8314)
@@ -53,8 +53,9 @@
/** Try again - returns true if we can retry */
protected boolean retry() {
+ retryCount++;
+ // We want 0, 1, ... maxRetries i.e. maxRetries+1 attempts
(maxRetries=0 => try once)
if(retryCount <= maxRetries || maxRetries == -1) {
- retryCount++;
schedule();
return true;
}
Modified: trunk/freenet/src/freenet/client/async/SingleBlockInserter.java
===================================================================
--- trunk/freenet/src/freenet/client/async/SingleBlockInserter.java
2006-03-25 16:56:53 UTC (rev 8313)
+++ trunk/freenet/src/freenet/client/async/SingleBlockInserter.java
2006-03-25 17:12:02 UTC (rev 8314)
@@ -1,7 +1,6 @@
package freenet.client.async;
import java.io.IOException;
-import java.lang.ref.SoftReference;
import java.lang.ref.WeakReference;
import java.net.MalformedURLException;
@@ -153,13 +152,13 @@
} else
consecutiveRNFs = 0;
Logger.minor(this, "Failed: "+e);
+ retries++;
if(retries > ctx.maxInsertRetries && ctx.maxInsertRetries !=
-1) {
if(errors.isOneCodeOnly())
fail(new
InserterException(errors.getFirstCode()));
else
fail(new
InserterException(InserterException.TOO_MANY_RETRIES_IN_BLOCKS, errors,
getURI()));
}
- retries++;
try {
getScheduler(encode()).register(this);
} catch (InserterException e1) {
Modified: trunk/freenet/src/freenet/node/Version.java
===================================================================
--- trunk/freenet/src/freenet/node/Version.java 2006-03-25 16:56:53 UTC (rev
8313)
+++ trunk/freenet/src/freenet/node/Version.java 2006-03-25 17:12:02 UTC (rev
8314)
@@ -20,7 +20,7 @@
public static final String protocolVersion = "1.0";
/** The build number of the current revision */
- private static final int buildNumber = 572;
+ private static final int buildNumber = 573;
/** Oldest build of Fred we will talk to */
private static final int lastGoodBuild = 507;