From: "Ian Clarke" <[email protected]>

>The FCP doc is somewhat unclear about what happens with metadata (ie. is
>it prepended to the data?  what format does it take?).
>Perhaps an example should be given with MIME-type metadata..

Hmm, seemed clear enough to me - the metadata if any comes first, then the
data, with the metadata length field telling the client where the metadata
(if any) stops and the data (if any) starts.

I'm close to finishing a platform-independent FCP C library (rough-as-guts
draft spec @ http://freeweb.sourceforge.net/spec.html), and Freenet has been
obeying the FCP doc faithfully (except with malformed URIs like
'KSK at freenet:CHK at sslkdslsdjl', in which case Freenet closes the connection
without bothering to send an error response).

Perhaps one point of clarification would be to spell out the fact that URIs
like 'freenet:SSK at duhduhduhduhduh/somename//' require metadata handling.(FCP
handler in Freenet currently handles mapfiles automatically, but I'm told
this is being taken out, so FCP clients will need to convert MSK URIs into
SSK/CHK/KSK URIs, then read the mapfile to determine the 'final' target
URI).

OK - here's an imaginary example, based on my tests. In this example, the
client is accessing a KSK which redirects to a CHK. (yeah - I know - this is
old-format metadata!)

(client to node)
    ClientGet<LF>
    URI=freenet:KSK at somekey<LF>
    HopsToLive=19<LF>
    EndMessage<LF>

(node to client)
    DataFound<LF>
    DataLength=29<LF>
    MetadataLength=29<LF>
    EndMessage<LF>
    DataChunk<LF>
    Length=29<LF>
    Data<LF>
    Redirect<LF>
    End<LF>
    freenet:CHK at duhduhduhduhduh<LF>

(new connection - client to node)
    ClientGet<LF>
    URI=freenet:CHK at duhduhduhduhduh<LF>
    HopsToLive=19<LF>
    EndMessage<LF>

(node to client)
    DataFound<LF>
    DataLength=59<LF>
    MetadataLength=19<LF>
    EndMessage<LF>
    DataChunk<LF>
    Length=nn<LF>
    Data<LF>
    Content-Type: text/plain<LF>
    This key contains two lines of text<LF>
    And here is the second line<LF>

Cheers
David



_______________________________________________
Devl mailing list
Devl at freenetproject.org
http://lists.freenetproject.org/mailman/listinfo/devl

Reply via email to