From cbc637e63fb0c9e5df1b352792cf90f2b40d102e Mon Sep 17 00:00:00 2001 From: Tollef Fog Heen Date: Sat, 27 Dec 2008 14:12:24 +0100 Subject: [PATCH] Rudimentary ideas about flow --- flow.txt | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 flow.txt diff --git a/flow.txt b/flow.txt new file mode 100644 index 0000000..062af27 --- /dev/null +++ b/flow.txt @@ -0,0 +1,27 @@ +S = Server +C = Client + +For binary data, we use the chunked encoding like what's defined in +RFC2616. The format is: "$size_of_chunk\r\n$chunk_data". We assume +that all data, filenames, signatures and delta are all binary. + +C: SIG\r\n$filename\r\n$signature +"I have $filename with $signature" +S: (OK|MISSING|NEWER|DELETE) +if OK: + File already exists in the same version on the server +if MISSING: + The server does not have a record of the file (so please upload it) + C: PUT $filename\r\n$delta + Delta is relative to an empty file. +if NEWER: + The server has a newer version of the file + C: DELTA $filename $signature + "Please give me the delta of $filename, from $signature" + S: $filename\r\n$delta +if DELETE: + The server has a record of the file being deleted, and the client + should do likewise. + +XXX: Conflicts. Client-side cache of signatures? Needs "generation" +on server too. -- 2.39.5