Author: toad
Date: 2006-12-21 19:45:01 +0000 (Thu, 21 Dec 2006)
New Revision: 11505
Modified:
trunk/freenet/src/freenet/client/FetchException.java
trunk/freenet/src/freenet/client/async/BaseClientGetter.java
trunk/freenet/src/freenet/client/async/ClientGetter.java
Log:
New failure code "All data not found".
Modified: trunk/freenet/src/freenet/client/FetchException.java
===================================================================
--- trunk/freenet/src/freenet/client/FetchException.java 2006-12-21
18:36:08 UTC (rev 11504)
+++ trunk/freenet/src/freenet/client/FetchException.java 2006-12-21
19:45:01 UTC (rev 11505)
@@ -170,6 +170,17 @@
Logger.minor(this,
"FetchException("+getMessage(mode)+"): "+msg,this);
}
+ public FetchException(FetchException e, int newMode) {
+ super(getMessage(newMode)+(e.extraMessage != null ? ":
"+e.extraMessage : ""));
+ this.mode = newMode;
+ this.newURI = e.newURI;
+ this.errorCodes = e.errorCodes;
+ this.expectedMimeType = e.expectedMimeType;
+ this.expectedSize = e.expectedSize;
+ this.extraMessage = e.extraMessage;
+ this.finalizedSizeAndMimeType = e.finalizedSizeAndMimeType;
+ }
+
public static String getShortMessage(int mode) {
switch(mode) {
case TOO_DEEP_ARCHIVE_RECURSION:
@@ -200,6 +211,8 @@
return "Temporary files error";
case DATA_NOT_FOUND:
return "Data not found";
+ case ALL_DATA_NOT_FOUND:
+ return "All data not found";
case ROUTE_NOT_FOUND:
return "Route not found";
case REJECTED_OVERLOAD:
@@ -280,6 +293,8 @@
return "Internal temp files error, maybe disk full or
permissions problem?";
case DATA_NOT_FOUND:
return "Data not found";
+ case ALL_DATA_NOT_FOUND:
+ return "Not enough data found; some data was fetched
but redirect may point to nowhere";
case ROUTE_NOT_FOUND:
return "Route not found - could not find enough nodes
to be sure the data doesn't exist";
case REJECTED_OVERLOAD:
@@ -342,6 +357,8 @@
public static final int BUCKET_ERROR = 12;
/** Data not found */
public static final int DATA_NOT_FOUND = 13;
+ /** Not all data was found; some DNFs but some successes */
+ public static final int ALL_DATA_NOT_FOUND = 28;
/** Route not found */
public static final int ROUTE_NOT_FOUND = 14;
/** Downstream overload */
@@ -399,6 +416,7 @@
case ROUTE_NOT_FOUND:
case REJECTED_OVERLOAD:
case TRANSFER_FAILED:
+ case ALL_DATA_NOT_FOUND:
return false;
case BUCKET_ERROR:
Modified: trunk/freenet/src/freenet/client/async/BaseClientGetter.java
===================================================================
--- trunk/freenet/src/freenet/client/async/BaseClientGetter.java
2006-12-21 18:36:08 UTC (rev 11504)
+++ trunk/freenet/src/freenet/client/async/BaseClientGetter.java
2006-12-21 19:45:01 UTC (rev 11505)
@@ -5,8 +5,9 @@
public abstract class BaseClientGetter extends ClientRequester implements
GetCompletionCallback {
-
+
protected BaseClientGetter(short priorityClass, ClientRequestScheduler
chkScheduler, ClientRequestScheduler sskScheduler, Object client) {
super(priorityClass, chkScheduler, sskScheduler, client);
}
+
}
Modified: trunk/freenet/src/freenet/client/async/ClientGetter.java
===================================================================
--- trunk/freenet/src/freenet/client/async/ClientGetter.java 2006-12-21
18:36:08 UTC (rev 11504)
+++ trunk/freenet/src/freenet/client/async/ClientGetter.java 2006-12-21
19:45:01 UTC (rev 11505)
@@ -133,6 +133,8 @@
}
}
finished = true;
+ if(e.mode == FetchException.DATA_NOT_FOUND &&
super.successfulBlocks > 0)
+ e = new FetchException(e,
FetchException.ALL_DATA_NOT_FOUND);
client.onFailure(e, this);
return;
}