Browse Source

Merge branch 'develop' of git.rwth-aachen.de:tobias.wach/ccats into develop

tobias.wach 4 years ago
parent
commit
564a2cd7d1
4 changed files with 28 additions and 9 deletions
  1. 1 1
      Client-Server Protocol.md
  2. 23 6
      GUI-CLI Protocol.md
  3. 3 1
      README.md
  4. 1 1
      cli/README.md

+ 1 - 1
Client-Server Protocol.md

@@ -2,7 +2,7 @@
 
 Protocol version: <b>"0.3"</b>
 
-Every json message must be minimized and be followed by a newline. This rule makes receiving and parsing the messages easier because you can read until a newline comes and you will parse every json message seperately because you won't read multiple json messages from the buffer at a time.
+Every json message must be minimized (i.e. must not contain newlines) and be followed by a newline. This rule makes receiving and parsing the messages easier because you can read until a newline comes and you will parse every json message seperately because you won't read multiple json messages from the buffer at a time.
 
 ## 1. Start a connection
 

+ 23 - 6
GUI-CLI Protocol.md

@@ -2,7 +2,7 @@
 
 Protocol version: <b>"0.3"</b>
 
-Every json message must be minimized and be followed by a newline. This rule makes receiving and parsing the messages easier because you can read until a newline comes and you will parse every json message seperately because you won't read multiple json messages from the buffer at a time.
+Every json message must be minimized (i.e. must not contain newlines) and be followed by a newline. This rule makes receiving and parsing the messages easier because you can read until a newline comes and you will parse every json message seperately because you won't read multiple json messages from the buffer at a time.
 
 ## 0. Connect to the server
 
@@ -64,7 +64,7 @@ CLI:
 }
 ```
 
-If `accept` is `true` the connection is valid and the user is logged in. Else `error` has an error string and the connection will be terminated after the server answered.
+If `accept` is `true` the connection is valid and the user is logged in. Else `error` has an error string and the connection to the server will be terminated after the server answered.
 
 ### 1.2.2 Signup
 GUI:
@@ -72,7 +72,7 @@ GUI:
 write: "signup" username new_password
 ```
 
-Server:
+CLI:
 ```
 {
 	"command": "signup",
@@ -81,7 +81,7 @@ Server:
 }
 ```
 
-If `accept` is `true` the connection is valid and the user is logged in and signed up. Else `error` has an error string and the connection will be terminated after the server answered.
+If `accept` is `true` the connection is valid and the user is logged in and signed up. Else `error` has an error string and the connection to the server will be terminated after the server answered.
 
 
 ## 2. Sending commands
@@ -298,7 +298,7 @@ Client:
 write: "queue" file_name
 ```
 
-Server:
+CLI:
 ```
 {
 	"command": "queue",
@@ -317,7 +317,7 @@ Client:
 write: "dequeue" file_name
 ```
 
-Server:
+CLI:
 ```
 {
 	"command": "dequeue",
@@ -388,3 +388,20 @@ CLI:
 ```
 
 If `accept` is true, the connection is closed and the program can exit.
+
+## 4. Errors
+
+If an unexpected error occurs, the GUI might receive an `error` message:
+```
+{
+	"command": "error",
+	"error": string
+}
+```
+If the server does not respond to requests for some time, the GUI receives a `connectionerror` message and the the connection to the server is terminated:
+```
+{
+	"command": "connectionerror",
+	"error": string
+}
+```

+ 3 - 1
README.md

@@ -52,7 +52,7 @@ Packages to install after minimal Ubuntu 19.10 installation:
 sudo apt install qtdeclarative5-dev libboost-all-dev libjsoncpp-dev libreadline-dev libpcap-dev build-essential qml-module-qt-labs-platform libssl-dev
 ```
 
-(NOTE: because of bug in jsoncpp, in the file size field of the gui, all numbers after the decimal point are displayed as 0. This bug occurs in version 1.7.4 and is fixed in 1.9.1 (or possibly earlier))
+(NOTE: Due to a bug in jsoncpp, in the file size field of the GUI, all numbers after the decimal point are displayed as 0. This bug occurs in version 1.7.4 and is fixed in 1.9.1 (or possibly earlier).)
 
 #### Install libtins
 ```
@@ -97,12 +97,14 @@ rm -rf googletest
 ## Build
 CMake is used as build system. It should check which dependency is missing and tell you.
 
+All three compontents can be built together using the top-level CMake file.
 ```
 mkdir build
 cd build
 cmake ..
 make
 ```
+The components can also be built seperately following the same instructions from the `./daemon/`, `./cli/` and `./gui/` directory.
 
 ### Build with tests
 ```

+ 1 - 1
cli/README.md

@@ -18,7 +18,7 @@ Batch mode. A batch file for the CLI must contain commands (as used in regular u
 ### Additional arguments
 
 `--usessl <certfile>`: <br/>
-Used to enable SSL communication with the server using the certificate file specified by the file path <i>&lt;certfile&gt;</i>. Needs to be passed if server is configured to use SSL encryption.
+Used to enable SSL communication with the server using the certificate file specified by the file path <i>&lt;certfile&gt;</i>. Needs to be passed if server is configured to use SSL encryption. Configurations where only one side has SSL encryption enabled are not supported.
 
 `--verbose`: <br/>
 Prints additional output for debugging purposes.