提交 f684490f authored 作者: blu's avatar blu

init

上级 bb442395
......@@ -42,19 +42,23 @@ class HttpSrv{
svr.Post("/config", [this](const Request& req, Response& res){
json ret;
ret["code"] = 0;
ret["msg"] = "ok";
ret["time"] = chrono::duration_cast<chrono::seconds>(chrono::system_clock::now().time_since_epoch()).count();
try{
json newConfig = json::parse(req.body);
json newConfig;
newConfig["data"] = json::parse(req.body)["data"];
newConfig["lastupdated"] = ret["time"];
LVDB::setLocalConfig(newConfig);
this->config = newConfig;
ret["code"] = 0;
ret["msg"] = "ok";
spdlog::info("evmgr new config: {}", newConfig.dump());
// TODO: restart other components
//
}catch(exception &e) {
ret.clear();
ret["code"] = 1;
ret["code"] = -1;
ret["msg"] = e.what();
ret["data"] = req.body;
}
res.set_content(ret.dump(), "text/json");
});
......
......@@ -234,6 +234,7 @@ private:
urlIn = "rtsp://" + user + ":" + passwd + "@" + ipc["addr"].get<string>() + ":" + ipcPort + "/h264/ch1/sub/av_stream";
addr = evpuller["addr"].get<string>();
spdlog::info("evpuller {} connecting to IPC {}", selfId, urlIn);
if(addr == "*" || addr == "0.0.0.0") {
spdlog::error("evpuller {} invalid addr {} for pub", selfId, evpuller.dump());
goto togo_sleep_continue;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论