aboutsummaryrefslogtreecommitdiffstats
path: root/src/hs-clientmanager.cpp
diff options
context:
space:
mode:
authorwang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>2019-04-19 16:27:49 +0800
committerwang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>2019-04-19 16:27:49 +0800
commitf16e0728c0c9806d9a7c3766028428ed73b5a8cf (patch)
tree0a28552d766170c85bcaa1ee60f582744524124c /src/hs-clientmanager.cpp
parent0fc1fc7db6ff7cb95ad6cd6f0ef8f2b88f3d08da (diff)
recover application
Change-Id: I02330f9c9336609ce585ab172211acada68fba9c
Diffstat (limited to 'src/hs-clientmanager.cpp')
-rw-r--r--src/hs-clientmanager.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/hs-clientmanager.cpp b/src/hs-clientmanager.cpp
index 1f8bc81..4a17b72 100644
--- a/src/hs-clientmanager.cpp
+++ b/src/hs-clientmanager.cpp
@@ -37,7 +37,7 @@ static void cbRemoveClientCtxt(void *data)
* None
*
*/
-HS_ClientManager::HS_ClientManager()
+HS_ClientManager::HS_ClientManager() : app_recover(nullptr)
{
}
@@ -187,6 +187,7 @@ int HS_ClientManager::handleRequest(afb_req_t request, const char *verb, const c
appid2ctxt[appid] = createClientCtxt(request, appid);
HS_Client* client = addClient(request, appid);
ret = client->handleRequest(request, "subscribe");
+ registerApplication(appid);
}
else {
AFB_NOTICE("not exist session");
@@ -231,4 +232,22 @@ int HS_ClientManager::pushEvent(const char *event, struct json_object *param, st
}
return 0;
+}
+
+/**
+ * register recovered application
+ *
+ * #### Parameters
+ * - appid : application id
+ *
+ * #### Return
+ * None
+ *
+ */
+void HS_ClientManager::registerApplication(std::string appid)
+{
+ if(app_recover != nullptr && app_recover->registerRecoveredApp(appid)) {
+ delete app_recover;
+ app_recover = nullptr;
+ }
} \ No newline at end of file