Prechádzať zdrojové kódy

added more explaination to the client-server protocol

Denys 4 rokov pred
rodič
commit
e95deb5d04
1 zmenil súbory, kde vykonal 10 pridanie a 3 odobranie
  1. 10 3
      Client-Server Protocol.md

+ 10 - 3
Client-Server Protocol.md

@@ -132,6 +132,7 @@ Server:
 	"error": string
 }
 ```
+`chunks` is the number of chunks that will be sent.
 
 #### 2.2.2 listdata - download file list
 Client:
@@ -142,6 +143,8 @@ Client:
 	"cancel": bool
 }
 ```
+Here `chunk` is the number of remaining chunks. (Thus, when requesting the first chunk the number of chunks - 1 is expected.)
+<br /><br />
 Server:
 ```
 {
@@ -169,7 +172,8 @@ Client:
 	"chunks": int
 }
 ```
-
+`chunks` is the number of chunks of the file to send.
+<br /><br />
 Server:
 ```
 {
@@ -207,7 +211,8 @@ Server:
 	"error": string
 }
 ```
-If `cancel` is `true` then the upload of the file is canceled and an error message should be in `error`.
+If `cancel` is `true` then the upload of the file is canceled and an error message should be in `error`. <br />
+Note that `received` is the number of remaining (!!!) chunks, here the server responds with the `remaining` value originally sent in the request.
 
 ### 2.4 Get command
 
@@ -246,6 +251,8 @@ Client:
 	"cancel": bool
 }
 ```
+
+Here `chunk` is a counter how many chunks will follow. (Thus, when requesting the first chunk, the number of chunks - 1 is expected.)
 If `cancel` is `true` then cancel the download of the file.
 <br /><br />
 Server:
@@ -260,7 +267,7 @@ Server:
 }
 ```
 `data` is a base64 string and contains a piece of the file. The client must request every chunk.
-`remaining` is a counter how many chunks will follow and the transfer is over after it hits `0`.
+`remaining` is a counter how many chunks will follow (so it equals the `chunk` value originally sent in the request) and the transfer is over after it hits `0`.
 If `cancel` is `true` then the download of the file is canceled and an error message should be in `error`.