浏览代码

fixed a few message types in cmdman

Denys 5 年之前
父节点
当前提交
77c876d578
共有 1 个文件被更改,包括 2 次插入4 次删除
  1. 2 4
      cli/src/cmdman.cpp

+ 2 - 4
cli/src/cmdman.cpp

@@ -96,13 +96,11 @@ CmdMan::CmdRet CmdMan::cmdPut(vector<string> args) {
   root["command"] = "put";
   root["command"] = "put";
   root["file"] = fileman.getPutName();
   root["file"] = fileman.getPutName();
   if (opened) {
   if (opened) {
-    root["command"] = "put";
-    root["file"] = fileman.getPutName();
     root["size"] = fileman.getPutSize();
     root["size"] = fileman.getPutSize();
     root["chunks"] = fileman.getPutChunks();
     root["chunks"] = fileman.getPutChunks();
     retval.type = send;
     retval.type = send;
   } else {
   } else {
-    retval.type = print | error;
+    retval.type = error;
     root["accept"] = false;
     root["accept"] = false;
     root["error"] = "couldnt open local file \"" + args[0] + "\"";
     root["error"] = "couldnt open local file \"" + args[0] + "\"";
   }
   }
@@ -173,7 +171,6 @@ CmdMan::CmdRet CmdMan::cmdList(vector<string> args) {
   root["command"] = "list";
   root["command"] = "list";
   if (opened) {
   if (opened) {
     retval.type = send;
     retval.type = send;
-    retval.msg = root;
   } else {
   } else {
     retval.type = error;
     retval.type = error;
     root["accept"] = false;
     root["accept"] = false;
@@ -181,6 +178,7 @@ CmdMan::CmdRet CmdMan::cmdList(vector<string> args) {
     root["error"] = "cannot list, already listing";
     root["error"] = "cannot list, already listing";
   }
   }
 
 
+  retval.msg = root;
   return retval;
   return retval;
 }
 }