Persistent requests: An FCP request is made persistent by the client setting Persistence=reboot or Persistence=forever on the ClientGet/ClientPut.
These requests are not discarded when the FCP connection is closed, but will persist until complete or until the node exits (if Persistence=reboot). They are associated with the client by name (from the ClientHello). Also, once a persistent request has completed, it persists until it is acknowledged by the client with a RemoveCompletedPersistentRequest, or until it falls off the end of the LRU (we keep the last 128 results). This is because of race conditions on losing FCP connections. When a client (identified by Name) reconnects, we send it the status of all unacknowledged completed persistent requests i.e. all persistent requests which have completed but which have not yet been acknowledged. Hopefully this will ensure that clients remove completed requests which they know about. When a client sends a ListPersistentRequests message, we send it the status of all persistent requests, either running or completed. Sending the status of a completed persistent request *includes the data* if it was ReturnType=direct. Persistent requests may include an additional field on the ClientGet, ClientToken. This is a string which is returned in PersistentGet's, which are sent as the first part of the status update. So: client connects: ClientHello Name=Toad ExpectedVersion=2 End ... client -> node: ClientGet Identifier=78171-a URI=KSK at gpl.txt ReturnType=disk Filename=/home/toad/gpl.txt Persistence=forever // retry forever ClientToken=the GPL // returned in the PersistentGet Verbosity=0 // don't send us status updates PolledVerbosity=1 // include SimpleProgress if we poll for status updates End ... client -> node: ListPersistentRequests End node -> client: ... PersistentGet Identifier=78171-a URI=KSK at gpl.txt ReturnType=disk Filename=/home/toad/gpl.txt ClientToken=the GPL End SimpleProgress ... End ... node -> client: DataFound Identifier=78171-a Size=32701 Metadata.ContentType=image/jpeg // this is why we don't use KSKs much! End ... client disconnects client reconnects: ClientHello Name=Toad ExpectedVersion=2.0 End node reply: NodeHello ... End node sends update on persistent unacked requests: identify the request: PersistentGet Identifier=78171-a URI=KSK at gpl.txt ReturnType=disk Filename=/home/toad/gpl.txt ClientToken=the GPL End current state: DataFound Identifier=78171-a Size=32701 Metadata.ContentType=image/jpeg End client acknowledges the completed request: RemoveCompletedPersistentRequest Identifier=78171-a End -- 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/tech/attachments/20060222/962f3e70/attachment.pgp>
