Author: toad
Date: 2007-06-21 15:10:20 +0000 (Thu, 21 Jun 2007)
New Revision: 13683
Modified:
trunk/freenet/src/freenet/client/async/SingleFileFetcher.java
trunk/freenet/src/freenet/clients/http/FProxyToadlet.java
trunk/freenet/src/freenet/clients/http/XMLSpider.java
Log:
Move NOT_ENOUGH_METASTRINGS suggested redirect logic into client layer
Modified: trunk/freenet/src/freenet/client/async/SingleFileFetcher.java
===================================================================
--- trunk/freenet/src/freenet/client/async/SingleFileFetcher.java
2007-06-21 14:21:38 UTC (rev 13682)
+++ trunk/freenet/src/freenet/client/async/SingleFileFetcher.java
2007-06-21 15:10:20 UTC (rev 13683)
@@ -235,14 +235,14 @@
if(logMINOR) Logger.minor(this, "Is simple
manifest");
String name;
if(metaStrings.isEmpty())
- throw new
FetchException(FetchException.NOT_ENOUGH_PATH_COMPONENTS);
+ throw new
FetchException(FetchException.NOT_ENOUGH_PATH_COMPONENTS, -1, false, null,
thisKey.addMetaStrings(new String[] { "" }));
else name = removeMetaString();
// Since metadata is a document, we just
replace metadata here
if(logMINOR) Logger.minor(this, "Next
meta-string: "+name);
if(name == null) {
metadata =
metadata.getDefaultDocument();
if(metadata == null)
- throw new
FetchException(FetchException.NOT_ENOUGH_PATH_COMPONENTS);
+ throw new
FetchException(FetchException.NOT_ENOUGH_PATH_COMPONENTS, -1, false, null,
thisKey.addMetaStrings(new String[] { "" }));
} 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 2007-06-21
14:21:38 UTC (rev 13682)
+++ trunk/freenet/src/freenet/clients/http/FProxyToadlet.java 2007-06-21
15:10:20 UTC (rev 13683)
@@ -372,9 +372,7 @@
String msg = e.getMessage();
if(Logger.shouldLog(Logger.MINOR, this))
Logger.minor(this, "Failed to fetch "+uri+" :
"+e);
- if(e.mode == FetchException.NOT_ENOUGH_PATH_COMPONENTS)
{
- this.writePermanentRedirect(ctx,
l10n("notEnoughMetaStrings"), '/' + key.toString() + '/' + override);
- } else if(e.newURI != null) {
+ if(e.newURI != null) {
this.writePermanentRedirect(ctx, msg, '/'
+e.newURI.toString() + override);
} else if(e.mode == FetchException.TOO_BIG) {
HTMLNode pageNode =
ctx.getPageMaker().getPageNode(l10n("fileInformationTitle"), ctx);
Modified: trunk/freenet/src/freenet/clients/http/XMLSpider.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/XMLSpider.java 2007-06-21
14:21:38 UTC (rev 13682)
+++ trunk/freenet/src/freenet/clients/http/XMLSpider.java 2007-06-21
15:10:20 UTC (rev 13683)
@@ -101,7 +101,7 @@
private HashMap urisToNumbers;
private NodeClientCore core;
private FetchContext ctx;
- private final short PRIORITY_CLASS =
RequestStarter.BULK_SPLITFILE_PRIORITY_CLASS;
+ private final short PRIORITY_CLASS =
RequestStarter.IMMEDIATE_SPLITFILE_PRIORITY_CLASS;
private boolean stopped = true;
PluginRespirator pr;
@@ -162,7 +162,7 @@
runningFetchesByURI.put(g.getURI(), g);
g.start();
FileWriter outp = new
FileWriter("logfile2",true);
- outp.write("URI
"+g.getURI().toString()+g.getURI().getSuggestedEdition());
+ outp.write("URI "+g.getURI().toString()+'\n');
outp.close();
} catch (FetchException e) {
@@ -1063,7 +1063,7 @@
allowedMIMETypes.add(new String("text/html"));
allowedMIMETypes.add(new String("text/plain"));
allowedMIMETypes.add(new String("application/xhtml+xml"));
- allowedMIMETypes.add(new String("application/zip"));
+// allowedMIMETypes.add(new String("application/zip"));
ctx.allowedMIMETypes = new HashSet(allowedMIMETypes);
// ctx.allowedMIMETypes.add("text/html");
tProducedIndex = System.currentTimeMillis();