Browse Source

removed falsely copied line of code and improved readability

Denys 5 years ago
parent
commit
87d9684e9b
1 changed files with 6 additions and 9 deletions
  1. 6 9
      cli/src/cmdman.cpp

+ 6 - 9
cli/src/cmdman.cpp

@@ -669,22 +669,19 @@ CmdMan::CmdRet CmdMan::handleSignup(Json::Value root) {
 
 CmdMan::CmdRet CmdMan::handleHead(Json::Value root) {
   CmdRet retval;
-  Json::Value output;
-  output["command"] = "head";
-  output["file"] = root["file"];
-  output["accept"] = false;
   DEBUGPRINT(string(__PRETTY_FUNCTION__) + " begin");
 
   if (!root["accept"].asBool()) {
-    retval.type = error;
+    Json::Value output;
+    output["command"] = "head";
+    output["file"] = root["file"];
     output["error"] = "Server reports: " + root["error"].asString();
+    retval.type = error;
+    retval.msg = output;
   } else {
-    fileman.setGetChunks(root["chunks"].asInt());
-    output["accept"] = true;
-    output["data"] = root["data"];
     retval.type = print;
+	retval.msg = root;
   }
-  retval.msg = output;
 
   return retval;
 }