On Tue, 26 Dec 2000, Brandon wrote:
> > > would refer to index.html. So, as a practical matter, we can type two
> > > extra characters, or we can click through an entry page. Hrmmm...
> > >
> > > I'm ambivalent about this now. Must think... must sleep...
> >
> > So just add Fproxy support for MSKs and have FProxy auto-redirect to the
> > right date.
>
> This shouldn't go in FProxy. It should go in a lower level library so that
> clients other than FProxy can support them. Just in case you ever want to
> use a client other than FProxy.
Here are the rules I want to implement for MSKs:
1) A key is a MSK if: (a) its keytype is explicitly set to MSK, i.e.,
"freenet:MSK@"; or (b) it is an implied KSK, and there is a "//", i.e,
"freenet:pigdogjournal//bad.jpeg", but *not* "freenet:KSK@blah//blah".
2) If there is no filename specified, i.e., "freenet:pigdogjournal//", it
is assumed to be "index.html".
3) The mapkey may be any Freenet keytype except MSK.
I don't think my (derivative of Brandon's) MSK proposal can be implemented
like the other keytypes, because it is very different. It's not an
extension of any existing keytype, and it's not a full-fledged keytype in
itself. Furthermore, the efficiency of MSKs relies on caching a hashtable
of filename=key pairs, and thus it is better implemented as I have, with a
MapHandler you instantiate that manages a cache of any number of
MapFiles. You feed it a URI, i.e., "freenet:pigdogjournal//", and it sends
back the URI of that file in the map. If the map is not already cached, it
requests it and caches it.
To generalize it for other clients, I'd remove the dependency on
ProxyClient. To use it, a client needs to check if the URI it wants to
grab is a MSK, if so, feed it to the MapHandler. So FreenetURI.java would
have to be made MSK-aware, and the Map* classes would have to be put in
the client directory.
To add support for MSKs to RequestClient, the obvious place to add it is
ClientUtil.getKey, but I would have to overload it with another version
that takes a MapHandler as an argument, and that's ugly and inefficient,
because the key might not even be a MSK. So I could add a isMSK method to
ClientUtil that takes the key string and checks. I'd do it in fillBuckets
before the ClientKey is initialized, and if it returns true, I'd
instantiate a MapHandler and run the key string through it first.
Ah well, I've probably comitted 10 trivial Java heresies already...
--
Mark Roberts
[EMAIL PROTECTED]
_______________________________________________
Freenet-dev mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/mailman/listinfo/freenet-dev