瀏覽代碼

add specification for head and deleteme to Client-Server protocol

Missingmew 4 年之前
父節點
當前提交
e29de198a8
共有 1 個文件被更改,包括 45 次插入0 次删除
  1. 45 0
      Client-Server Protocol.md

+ 45 - 0
Client-Server Protocol.md

@@ -270,6 +270,51 @@ Server:
 `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`.
 
+### 2.5 Head command
+
+The `head` command requests the first 4 bytes of `file` from the server for further inspection by the client.
+
+Client:
+```
+{
+	"command": "head",
+	"file": string
+}
+```
+
+Server:
+```
+{
+	"command": "head",
+	"accept": bool,
+	"file": string,
+	"data": string,
+	"error": string
+}
+```
+`data` is a base64 encoded string containing the requested bytes of the file.
+
+### 2.6 Deleteme command
+
+The `deleteme` command allows a logged in user to delete their account on the server. This action needs to be confirmed with the users password.
+
+Client:
+```
+{
+	"command": "deleteme",
+	"pass": string
+}
+```
+
+Server:
+```
+{
+	"command": "deleteme",
+	"accept": bool,
+	"error": string
+}
+```
+If `accept` is true the user has been deleted and the connection will be closed by the server.
 
 ### TODO