Author: toad
Date: 2008-06-19 12:27:30 +0000 (Thu, 19 Jun 2008)
New Revision: 20479
Modified:
branches/db4o/freenet/src/freenet/client/FetchContext.java
branches/db4o/freenet/src/freenet/client/HighLevelSimpleClientImpl.java
branches/db4o/freenet/src/freenet/client/async/SingleFileFetcher.java
branches/db4o/freenet/src/freenet/client/async/USKManager.java
Log:
Remove USKManager from FetchContext.
Modified: branches/db4o/freenet/src/freenet/client/FetchContext.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/FetchContext.java 2008-06-19
10:56:52 UTC (rev 20478)
+++ branches/db4o/freenet/src/freenet/client/FetchContext.java 2008-06-19
12:27:30 UTC (rev 20479)
@@ -21,7 +21,6 @@
/** Low-level client to send low-level requests to. */
public long maxOutputLength;
public long maxTempLength;
- public USKManager uskManager;
public int maxRecursionLevel;
public int maxArchiveRestarts;
public int maxArchiveLevels;
@@ -53,10 +52,9 @@
boolean allowSplitfiles, boolean followRedirects,
boolean localRequestOnly,
int maxDataBlocksPerSegment, int
maxCheckBlocksPerSegment,
BucketFactory bucketFactory,
- ClientEventProducer producer, boolean
cacheLocalRequests, USKManager uskManager,
+ ClientEventProducer producer, boolean
cacheLocalRequests,
boolean ignoreTooManyPathComponents) {
this.maxOutputLength = curMaxLength;
- this.uskManager = uskManager;
this.maxTempLength = curMaxTempLength;
this.maxMetadataSize = maxMetadataSize;
this.maxRecursionLevel = maxRecursionLevel;
@@ -81,7 +79,6 @@
this.eventProducer = ctx.eventProducer;
else
this.eventProducer = new SimpleEventProducer();
- this.uskManager = ctx.uskManager;
this.ignoreTooManyPathComponents =
ctx.ignoreTooManyPathComponents;
this.blocks = ctx.blocks;
this.allowedMIMETypes = ctx.allowedMIMETypes;
Modified:
branches/db4o/freenet/src/freenet/client/HighLevelSimpleClientImpl.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/HighLevelSimpleClientImpl.java
2008-06-19 10:56:52 UTC (rev 20478)
+++ branches/db4o/freenet/src/freenet/client/HighLevelSimpleClientImpl.java
2008-06-19 12:27:30 UTC (rev 20479)
@@ -189,7 +189,7 @@
FETCH_SPLITFILES, FOLLOW_REDIRECTS,
LOCAL_REQUESTS_ONLY,
MAX_SPLITFILE_BLOCKS_PER_SEGMENT,
MAX_SPLITFILE_CHECK_BLOCKS_PER_SEGMENT,
bucketFactory, globalEventProducer,
- cacheLocalRequests, core.uskManager, false);
+ cacheLocalRequests, false);
}
public InsertContext getInsertContext(boolean forceNonPersistent) {
Modified: branches/db4o/freenet/src/freenet/client/async/SingleFileFetcher.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/async/SingleFileFetcher.java
2008-06-19 10:56:52 UTC (rev 20478)
+++ branches/db4o/freenet/src/freenet/client/async/SingleFileFetcher.java
2008-06-19 12:27:30 UTC (rev 20479)
@@ -732,11 +732,11 @@
private static ClientGetState uskCreate(ClientRequester requester,
GetCompletionCallback cb, ClientMetadata clientMetadata, USK usk, LinkedList
metaStrings, FetchContext ctx, ArchiveContext actx, int maxRetries, int
recursionLevel, boolean dontTellClientGet, long l, boolean isEssential, Bucket
returnBucket, boolean isFinal, ObjectContainer container, ClientContext
context) throws FetchException {
if(usk.suggestedEdition >= 0) {
// Return the latest known version but at least
suggestedEdition.
- long edition = ctx.uskManager.lookup(usk);
+ long edition = context.uskManager.lookup(usk);
if(edition <= usk.suggestedEdition) {
// Background fetch - start background fetch
first so can pick up updates in the datastore during registration.
-
ctx.uskManager.startTemporaryBackgroundFetcher(usk, context);
- edition = ctx.uskManager.lookup(usk);
+
context.uskManager.startTemporaryBackgroundFetcher(usk, context);
+ edition = context.uskManager.lookup(usk);
if(edition > usk.suggestedEdition) {
if(logMINOR)
Logger.minor(SingleFileFetcher.class, "Redirecting to edition "+edition);
cb.onFailure(new
FetchException(FetchException.PERMANENT_REDIRECT,
usk.copy(edition).getURI().addMetaStrings(metaStrings)), null, container,
context);
@@ -759,7 +759,7 @@
} else {
// Do a thorough, blocking search
USKFetcherTag tag =
-
ctx.uskManager.getFetcher(usk.copy(-usk.suggestedEdition), ctx, false,
requester.persistent(),
+
context.uskManager.getFetcher(usk.copy(-usk.suggestedEdition), ctx, false,
requester.persistent(),
new
MyUSKFetcherCallback(requester, cb, clientMetadata, usk, metaStrings, ctx,
actx, maxRetries, recursionLevel, dontTellClientGet, l, returnBucket),
container, context);
if(isEssential)
requester.addMustSucceedBlocks(1);
Modified: branches/db4o/freenet/src/freenet/client/async/USKManager.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/async/USKManager.java
2008-06-19 10:56:52 UTC (rev 20478)
+++ branches/db4o/freenet/src/freenet/client/async/USKManager.java
2008-06-19 12:27:30 UTC (rev 20479)
@@ -52,7 +52,6 @@
public USKManager(NodeClientCore core) {
backgroundFetchContext =
core.makeClient(RequestStarter.UPDATE_PRIORITY_CLASS).getFetchContext();
backgroundFetchContext.followRedirects = false;
- backgroundFetchContext.uskManager = this;
latestVersionByClearUSK = new HashMap();
subscribersByClearUSK = new HashMap();
fetchersByUSK = new HashMap();