Browse Source

Splitting list command in list and getlist

Jonas Pflanzer 5 years ago
parent
commit
062268e598
1 changed files with 26 additions and 5 deletions
  1. 26 5
      Client-Server Protocol.md

+ 26 - 5
Client-Server Protocol.md

@@ -113,23 +113,44 @@ Server:
 ```
 
 ### 2.2 List command
+List is split in two commands. `list` to request a list download and `getlist` to download the list.
+
+#### 2.2.1 list - request file list download
 Client:
 ```
 {
 	"command": "list"
 }
 ```
-
 Server:
 ```
 {
 	"command": "list",
-	"names": string[],
-	"sizes": int[],
-	"remaining": int
+	"accept": bool,
+	"items": int,
+	"chunks": int
+}
+```
+
+#### 2.2.2 getlist - download file list
+Client:
+```
+{
+	"command": "getlist",
+	"chunk": int,
+	"cancel": bool
+}
+```
+Server:
+```
+{
+	"command": "getlist",
+	"remaining": int,
+	"cancel": bool,
+	"names": string[]
 }
 ```
-The server loops this until all names have been sent and `remaining` hits `0`.
+The client has to request every chunk until all names have been sent and `remaining` hits `0`.
 
 
 ### 2.3 Put command