Преглед на файлове

Status message reports about upload and download

anon преди 5 години
родител
ревизия
025a2e975a
променени са 1 файла, в които са добавени 12 реда и са изтрити 1 реда
  1. 12 1
      daemon/src/Server.cpp

+ 12 - 1
daemon/src/Server.cpp

@@ -185,7 +185,18 @@ void con_handler::handle_read_command(const boost::system::error_code &err,
       answer["command"] = "status";
 
       // TODO answer a real status message
-      answer["response"] = "This is a status message :)";
+      std::string response;
+      if (this->getFile.is_open() && this->putFile.is_open()) {
+        response = "download and upload running";
+      } else if (this->putFile.is_open()) {
+        response = "upload running";
+      } else if (this->getFile.is_open()) {
+        response = "download running";
+      } else {
+        response = "ok";
+      }
+
+      answer["response"] = response;
       const std::string answerString = Json::writeString(stringBuilder, answer);
 
       // send answer