|
@@ -109,6 +109,7 @@ CmdMan::CmdRet CmdMan::cmdPut(vector<string> args) {
|
|
CmdRet retval;
|
|
CmdRet retval;
|
|
DEBUGPRINT(string(__PRETTY_FUNCTION__) + " begin");
|
|
DEBUGPRINT(string(__PRETTY_FUNCTION__) + " begin");
|
|
Json::Value root;
|
|
Json::Value root;
|
|
|
|
+ root["command"] = "put";
|
|
|
|
|
|
if (args.size() < 1) {
|
|
if (args.size() < 1) {
|
|
retval.type = error;
|
|
retval.type = error;
|
|
@@ -116,7 +117,6 @@ CmdMan::CmdRet CmdMan::cmdPut(vector<string> args) {
|
|
root["error"] = "not enough arguments, at least 1 argument required";
|
|
root["error"] = "not enough arguments, at least 1 argument required";
|
|
} else {
|
|
} else {
|
|
bool opened = fileman.openPut(args[0]);
|
|
bool opened = fileman.openPut(args[0]);
|
|
- root["command"] = "put";
|
|
|
|
root["file"] = fileman.getPutName();
|
|
root["file"] = fileman.getPutName();
|
|
if (opened) {
|
|
if (opened) {
|
|
root["size"] = fileman.getPutSize();
|
|
root["size"] = fileman.getPutSize();
|
|
@@ -155,6 +155,7 @@ CmdMan::CmdRet CmdMan::cmdGet(vector<string> args) {
|
|
CmdRet retval;
|
|
CmdRet retval;
|
|
DEBUGPRINT(string(__PRETTY_FUNCTION__) + " begin");
|
|
DEBUGPRINT(string(__PRETTY_FUNCTION__) + " begin");
|
|
Json::Value root;
|
|
Json::Value root;
|
|
|
|
+ root["command"] = "get";
|
|
|
|
|
|
if (args.size() < 1) {
|
|
if (args.size() < 1) {
|
|
retval.type = error;
|
|
retval.type = error;
|
|
@@ -162,7 +163,6 @@ CmdMan::CmdRet CmdMan::cmdGet(vector<string> args) {
|
|
root["error"] = "not enough arguments, at least 1 argument required";
|
|
root["error"] = "not enough arguments, at least 1 argument required";
|
|
} else {
|
|
} else {
|
|
bool opened = fileman.openGet(args[0]);
|
|
bool opened = fileman.openGet(args[0]);
|
|
- root["command"] = "get";
|
|
|
|
root["file"] = fileman.getGetName();
|
|
root["file"] = fileman.getGetName();
|
|
if (opened) {
|
|
if (opened) {
|
|
retval.type = send;
|
|
retval.type = send;
|