Author: toad
Date: 2006-11-01 18:08:49 +0000 (Wed, 01 Nov 2006)
New Revision: 10781
Modified:
trunk/freenet/src/freenet/client/FetchException.java
trunk/freenet/src/freenet/client/async/SingleFileFetcher.java
trunk/freenet/src/freenet/clients/http/FProxyToadlet.java
trunk/freenet/src/freenet/clients/http/filter/CSSTokenizerFilter.java
Log:
We already had a suitable error code.
Rename some more error codes.
Modified: trunk/freenet/src/freenet/client/FetchException.java
===================================================================
--- trunk/freenet/src/freenet/client/FetchException.java 2006-11-01
18:03:37 UTC (rev 10780)
+++ trunk/freenet/src/freenet/client/FetchException.java 2006-11-01
18:08:49 UTC (rev 10781)
@@ -167,7 +167,7 @@
return "Too much recursion";
case NOT_IN_ARCHIVE:
return "Not in archive";
- case HAS_MORE_METASTRINGS:
+ case TOO_MANY_PATH_COMPONENTS:
return "Not a manifest";
case BUCKET_ERROR:
return "Temporary files error";
@@ -191,7 +191,7 @@
return "Metadata too big";
case TOO_MANY_BLOCKS_PER_SEGMENT:
return "Too many blocks per segment";
- case NOT_ENOUGH_METASTRINGS:
+ case NOT_ENOUGH_PATH_COMPONENTS:
return "Not enough meta-strings"; // FIXME better
description
case CANCELLED:
return "Cancelled";
@@ -199,8 +199,6 @@
return "Archive restarted";
case PERMANENT_REDIRECT:
return "New URI";
- case TOO_MANY_META_STRINGS:
- return "Too many path elements";
default:
return "Unknown code "+mode;
}
@@ -249,7 +247,7 @@
return "Too many redirects (too much recursion)"; //
FIXME: ???
case NOT_IN_ARCHIVE:
return "File not in archive";
- case HAS_MORE_METASTRINGS:
+ case TOO_MANY_PATH_COMPONENTS:
return "Not a manifest";
case BUCKET_ERROR:
return "Internal temp files error, maybe disk full or
permissions problem?";
@@ -273,7 +271,7 @@
return "Metadata too big";
case TOO_MANY_BLOCKS_PER_SEGMENT:
return "Too many blocks per segment";
- case NOT_ENOUGH_METASTRINGS:
+ case NOT_ENOUGH_PATH_COMPONENTS:
return "Give more metastrings (path components) in URI";
// FIXME better description for above
case CANCELLED:
@@ -282,8 +280,6 @@
return "Archive restarted";
case PERMANENT_REDIRECT:
return "Permanent redirect: use the new URI";
- case TOO_MANY_META_STRINGS:
- return "Too many path elements: try chopping one off";
default:
return "Unknown fetch error code: "+mode;
}
@@ -313,8 +309,8 @@
public static final int TOO_MUCH_RECURSION = 9;
/** Tried to access an archive file but not in an archive */
public static final int NOT_IN_ARCHIVE = 10;
- /** Has more metastrings, can't fulfill them */
- public static final int HAS_MORE_METASTRINGS = 11;
+ /** Too many meta strings. E.g. requesting CHK at blah,blah,blah as CHK
at blah,blah,blah/filename.ext */
+ public static final int TOO_MANY_PATH_COMPONENTS = 11;
/** Failed to read from or write to a bucket; a kind of internal error
*/
public static final int BUCKET_ERROR = 12;
/** Data not found */
@@ -338,15 +334,13 @@
/** Splitfile has too big segments */
public static final int TOO_MANY_BLOCKS_PER_SEGMENT = 23;
/** Not enough meta strings in URI given and no default document */
- public static final int NOT_ENOUGH_METASTRINGS = 24;
+ public static final int NOT_ENOUGH_PATH_COMPONENTS = 24;
/** Explicitly cancelled */
public static final int CANCELLED = 25;
/** Archive restart */
public static final int ARCHIVE_RESTART = 26;
/** There is a more recent version of the USK, ~= HTTP 301; FProxy will
turn this into a 301 */
public static final int PERMANENT_REDIRECT = 27;
- /** Too many meta strings. E.g. requesting CHK at blah,blah,blah as CHK
at blah,blah,blah/filename.ext */
- public static final int TOO_MANY_META_STRINGS = 28;
/** Is an error fatal i.e. is there no point retrying? */
public boolean isFatal() {
@@ -358,8 +352,8 @@
// Problems with the data as inserted, or the URI given. No
point retrying.
case ARCHIVE_FAILURE:
case BLOCK_DECODE_ERROR:
- case HAS_MORE_METASTRINGS:
- case NOT_ENOUGH_METASTRINGS:
+ case TOO_MANY_PATH_COMPONENTS:
+ case NOT_ENOUGH_PATH_COMPONENTS:
case INVALID_METADATA:
case NOT_IN_ARCHIVE:
case TOO_DEEP_ARCHIVE_RECURSION:
@@ -371,7 +365,6 @@
case UNKNOWN_SPLITFILE_METADATA:
case INVALID_URI:
case TOO_BIG:
- case TOO_MANY_META_STRINGS:
return true;
// Low level errors, can be retried
Modified: trunk/freenet/src/freenet/client/async/SingleFileFetcher.java
===================================================================
--- trunk/freenet/src/freenet/client/async/SingleFileFetcher.java
2006-11-01 18:03:37 UTC (rev 10780)
+++ trunk/freenet/src/freenet/client/async/SingleFileFetcher.java
2006-11-01 18:08:49 UTC (rev 10781)
@@ -197,7 +197,7 @@
if(logMINOR) Logger.minor(this, "Is simple
manifest");
String name;
if(metaStrings.isEmpty())
- throw new
FetchException(FetchException.NOT_ENOUGH_METASTRINGS);
+ throw new
FetchException(FetchException.NOT_ENOUGH_PATH_COMPONENTS);
else
name = (String)
metaStrings.removeFirst();
// Since metadata is a document, we just
replace metadata here
@@ -205,7 +205,7 @@
if(name == null) {
metadata =
metadata.getDefaultDocument();
if(metadata == null)
- throw new
FetchException(FetchException.NOT_ENOUGH_METASTRINGS);
+ throw new
FetchException(FetchException.NOT_ENOUGH_PATH_COMPONENTS);
} else {
metadata = metadata.getDocument(name);
thisKey = thisKey.pushMetaString(name);
Modified: trunk/freenet/src/freenet/clients/http/FProxyToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/FProxyToadlet.java 2006-11-01
18:03:37 UTC (rev 10780)
+++ trunk/freenet/src/freenet/clients/http/FProxyToadlet.java 2006-11-01
18:08:49 UTC (rev 10781)
@@ -244,7 +244,7 @@
} catch (FetchException e) {
String msg = e.getMessage();
String extra = "";
- if(e.mode == FetchException.NOT_ENOUGH_METASTRINGS) {
+ if(e.mode == FetchException.NOT_ENOUGH_PATH_COMPONENTS)
{
this.writePermanentRedirect(ctx, "Not enough
meta-strings", "/" + URLEncoder.encode(key.toString(false)) + "/");
} else if(e.newURI != null) {
this.writePermanentRedirect(ctx, msg,
"/"+e.newURI.toString());
Modified: trunk/freenet/src/freenet/clients/http/filter/CSSTokenizerFilter.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/filter/CSSTokenizerFilter.java
2006-11-01 18:03:37 UTC (rev 10780)
+++ trunk/freenet/src/freenet/clients/http/filter/CSSTokenizerFilter.java
2006-11-01 18:08:49 UTC (rev 10781)
@@ -1,4 +1,4 @@
-/* The following code was generated by JFlex 1.4.1 on 28/10/06 00:17 */
+/* The following code was generated by JFlex 1.4.1 on 31/10/06 20:19 */
/* This code is part of Freenet. It is distributed under the GNU General
* Public License, version 2 (or at your option any later version). See
@@ -14,7 +14,7 @@
/**
* This class is a scanner generated by
* <a href="http://www.jflex.de/">JFlex</a> 1.4.1
- * on 28/10/06 00:17 from the specification file
+ * on 31/10/06 20:19 from the specification file
* <tt>freenet/clients/http/filter/CSSTokenizerFilter.jflex</tt>
*/
class CSSTokenizerFilter {