Major simplification:
The search below is only necessary because we might want to access an
archive with no metadata. If we require that there is always a metadata
manifest, we can just look it up in the manifest, rather than in the
cache (with the uncertainty that produces). If we are going to do it
this way, we might as well not support zip manifests directly but only
via archive redirects.

An archive redirect = a flag set in the flags section which indicates to
fetch the file or splitfile as usual, then retrieve a particular file
from it. Since this can be set even on an indirect-metadata document, we
can achieve the same functionality, but in a simpler way. The
incremental search required below would still be necessary if we choose
to abolish the double-slash, but it would only ever search inside a
metadata manifest.

On Wed, Oct 26, 2005 at 04:04:10PM +0100, Matthew Toseland wrote:
> It has been suggested on several occasions that // is ugly. Unix-derived
> tools usually expect that // means /.
> 
> So, what if we use / ?:
> 
> Archive manifests and metadata manifests are required to be consistent.
> Meaning no two files have the same name, and no directory has the same
> name as any file. This is checked when we fetch them the first time.
> 
> We break a URL up into a client-key (a decodable CHK or SSK) and a
> series of meta-strings:
> 
> SSK at .../News/images/war/protest.png
> 
> Client-key is SSK at .../News
> Meta-strings: images, war, protest.png
> 
> Then:
> 
> The first time:
> 
> Fetch the client-key.
> The fetched data says "fetch this splitfile, it is a ZIP manifest".
> We fetch the splitfile.
> We unpack the ZIP into cache.
> We read the unpacked metadata file (".metadata").
> We search for a cached manifest or file called "images".
> We search for a cached manifest or file called "images/war".
> We search for a cached manifest or file called "images/war/protest.png".
> We find it, and return it to the user.
> 
> 
> Much later:
> 
> Fetch the client-key from cache.
> The fetched data says "fetch this splitfile, it is a ZIP manifest".
> We look it up in the archive cache, and find the metadata is cached.
> We read the metadata.
> We search for a cached manifest or file called "images".
> We search for a cached manifest or file called "images/war".
> We search for a cached manifest or file called "images/war/protest.png".
> It isn't in the cache.
> We fetch the splitfile.
> We do the search again, find the file, and return it to the user.
-- 
Matthew J Toseland - toad at amphibian.dyndns.org
Freenet Project Official Codemonkey - http://freenetproject.org/
ICTHUS - Nothing is impossible. Our Boss says so.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20051026/b0181004/attachment.pgp>

Reply via email to