On 2/1/07, Matthew Toseland <toad at amphibian.dyndns.org> wrote: > On Tue, Jan 30, 2007 at 08:05:42PM +0100, bbackde at googlemail.com wrote: > > A TestDDA functionality in the node would be great. > > > > Client to node: > > > > TestDDA > > FileToWrite=c:\dir\file-123.tmp > > WriteContent =<unique token> > > FileToRead=c:\dir\file.456.tmp > > ReadContent=<unique token> > > EndMessage > > For security reasons the actual written data must be generated by the > node. So drop WriteContent.
Ok, good point. > > > > Node to client: > > > > TestDDAResponse > > FileWritten=true > > FileRead=true > > ReadContent=<same unique read token> > > Shouldn't that be WriteContent? It's the content that the node wrote to > the file... When WriteContent (see above) is dropped, then yes, we need a WriteContent in this message to figure out what the node wrote into the file. > > > EndMessage > > Okay, with the usual conditions - if the file already exists, the node > returns an error message. > > How to deal with errors, in fact? > > TestDDAResponse > FileRead=true > FileWritten=false > WriteFailureReason=Permission denied > WriteFailureCode=1 > End > > Meaning that the read test succeeded but the write test failed because > the node does not have permission to write the file. Yeah, like this. > > > > This way the client can check if the file was really written (check > > unique token in file) and if the node was able to read the other > > unique token from the specified file. If something fails the client > > could still use DDA for PUTs (read allowed) or for GETs (write > > allowed). > > > > Just an idea.... > > It's a good idea. I've filed a bug for it. If you want to implement it > yourself then assign it to yourself, otherwise I will get around to > it... eventually... > > https://bugs.freenetproject.org/view.php?id=1086 We need another message to tell the node to delete the previously written temp file in case the client is not on the same box, and therefore the write test failed for the client. E.g. node and client are on linux, client tells node to write to /tmp, and client can't find the file in /tmp. So the request must be stateful, the node must remember what file was written and must delete it after the client delete request. In the case the client misses to send a delete, the node must delete the file during JVM shutdown (File.deleteOnExit). Did I miss something?