|
@@ -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;
|
|
|
}
|