Author: toad
Date: 2009-02-19 00:35:57 +0000 (Thu, 19 Feb 2009)
New Revision: 25713
Modified:
branches/db4o/freenet/src/freenet/client/FetchContext.java
branches/db4o/freenet/src/freenet/client/HighLevelSimpleClientImpl.java
Log:
Add a separate context setting for USK retries. Make it cooldown-1 by default
(no way to modify as yet). This fixes persistent requests for USKs, because the
default maxretries for a persistent request is -1, which obviously is bad for a
u...@.../-N/ fetch.
Modified: branches/db4o/freenet/src/freenet/client/FetchContext.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/FetchContext.java 2009-02-18
22:34:48 UTC (rev 25712)
+++ branches/db4o/freenet/src/freenet/client/FetchContext.java 2009-02-19
00:35:57 UTC (rev 25713)
@@ -29,6 +29,7 @@
public int maxSplitfileThreads;
public int maxSplitfileBlockRetries;
public int maxNonSplitfileRetries;
+ public int maxUSKRetries;
public boolean allowSplitfiles;
public boolean followRedirects;
public boolean localRequestOnly;
@@ -50,7 +51,7 @@
public FetchContext(long curMaxLength,
long curMaxTempLength, int maxMetadataSize, int
maxRecursionLevel, int maxArchiveRestarts, int maxArchiveLevels,
boolean dontEnterImplicitArchives, int
maxSplitfileThreads,
- int maxSplitfileBlockRetries, int
maxNonSplitfileRetries,
+ int maxSplitfileBlockRetries, int
maxNonSplitfileRetries, int maxUSKRetries,
boolean allowSplitfiles, boolean followRedirects,
boolean localRequestOnly,
int maxDataBlocksPerSegment, int
maxCheckBlocksPerSegment,
BucketFactory bucketFactory,
@@ -67,6 +68,7 @@
this.maxSplitfileThreads = maxSplitfileThreads;
this.maxSplitfileBlockRetries = maxSplitfileBlockRetries;
this.maxNonSplitfileRetries = maxNonSplitfileRetries;
+ this.maxUSKRetries = maxUSKRetries;
this.allowSplitfiles = allowSplitfiles;
this.followRedirects = followRedirects;
this.localRequestOnly = localRequestOnly;
@@ -96,6 +98,7 @@
else
this.blocks = ctx.blocks;
this.allowedMIMETypes = ctx.allowedMIMETypes;
+ this.maxUSKRetries = ctx.maxUSKRetries;
if(maskID == IDENTICAL_MASK) {
this.maxOutputLength = ctx.maxOutputLength;
this.maxMetadataSize = ctx.maxMetadataSize;
Modified:
branches/db4o/freenet/src/freenet/client/HighLevelSimpleClientImpl.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/HighLevelSimpleClientImpl.java
2009-02-18 22:34:48 UTC (rev 25712)
+++ branches/db4o/freenet/src/freenet/client/HighLevelSimpleClientImpl.java
2009-02-19 00:35:57 UTC (rev 25713)
@@ -60,6 +60,7 @@
static final int SPLITFILE_BLOCK_RETRIES = Math.min(3,
RequestScheduler.COOLDOWN_RETRIES-1);
/** Number of retries allowed on non-splitfile fetches. */
static final int NON_SPLITFILE_RETRIES = Math.min(3,
RequestScheduler.COOLDOWN_RETRIES-1);
+ static final int USK_RETRIES = RequestScheduler.COOLDOWN_RETRIES - 1;
/** Whether to fetch splitfiles. Don't turn this off! */
static final boolean FETCH_SPLITFILES = true;
/** Whether to follow redirects etc. If false, we only fetch a plain
block of data.
@@ -200,7 +201,7 @@
return
new FetchContext(maxLength, maxTempLength,
curMaxMetadataLength,
MAX_RECURSION, MAX_ARCHIVE_RESTARTS,
MAX_ARCHIVE_LEVELS, DONT_ENTER_IMPLICIT_ARCHIVES,
- SPLITFILE_THREADS, SPLITFILE_BLOCK_RETRIES,
NON_SPLITFILE_RETRIES,
+ SPLITFILE_THREADS, SPLITFILE_BLOCK_RETRIES,
NON_SPLITFILE_RETRIES, USK_RETRIES,
FETCH_SPLITFILES, FOLLOW_REDIRECTS,
LOCAL_REQUESTS_ONLY,
MAX_SPLITFILE_BLOCKS_PER_SEGMENT,
MAX_SPLITFILE_CHECK_BLOCKS_PER_SEGMENT,
bucketFactory, globalEventProducer,
_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs