Author: toad
Date: 2008-07-01 11:24:59 +0000 (Tue, 01 Jul 2008)
New Revision: 20901

Modified:
   branches/db4o/freenet/src/freenet/client/async/SingleFileFetcher.java
Log:
Fix spurious "Not in archive"

Modified: branches/db4o/freenet/src/freenet/client/async/SingleFileFetcher.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/async/SingleFileFetcher.java       
2008-07-01 11:06:17 UTC (rev 20900)
+++ branches/db4o/freenet/src/freenet/client/async/SingleFileFetcher.java       
2008-07-01 11:24:59 UTC (rev 20901)
@@ -280,16 +280,23 @@
                                        throw new 
FetchException(FetchException.NOT_ENOUGH_PATH_COMPONENTS, -1, false, null, 
uri.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(logMINOR) Logger.minor(this, "Next 
meta-string: "+name+" length "+name.length()+" for "+this);
                                if(name == null) {
                                        metadata = 
metadata.getDefaultDocument();
-                                       if(persistent) container.set(this);
+                                       if(persistent) {
+                                               container.set(this);
+                                               container.set(metaStrings);
+                                       }
                                        if(metadata == null)
                                                throw new 
FetchException(FetchException.NOT_ENOUGH_PATH_COMPONENTS, -1, false, null, 
uri.addMetaStrings(new String[] { "" }));
                                } else {
                                        metadata = metadata.getDocument(name);
                                        thisKey = thisKey.pushMetaString(name);
-                                       if(persistent) container.set(this);
+                                       if(persistent) {
+                                               container.set(this);
+                                               container.set(metaStrings);
+                                               container.set(thisKey);
+                                       }
                                        if(metadata == null)
                                                throw new 
FetchException(FetchException.NOT_IN_ARCHIVE);
                                }


Reply via email to