修复close stream接口返回code不正确的问题

This commit is contained in:
xiongziliang 2020-10-24 23:31:40 +08:00
parent 8cb564de0a
commit 67e49cb66e

View File

@ -496,12 +496,12 @@ void installWebApi() {
allArgs["vhost"],
allArgs["app"],
allArgs["stream"]);
if(src){
if (src) {
bool flag = src->close(allArgs["force"].as<bool>());
val["result"] = flag ? 0 : -1;
val["msg"] = flag ? "success" : "close failed";
val["code"] = API::OtherFailed;
}else{
val["code"] = flag ? API::Success : API::OtherFailed;
} else {
val["result"] = -2;
val["msg"] = "can not find the stream";
val["code"] = API::OtherFailed;