aboutsummaryrefslogtreecommitdiffstats
path: root/src/hs-clientmanager.h
diff options
context:
space:
mode:
authorwang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>2019-06-20 15:18:21 +0800
committerwang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>2019-06-20 16:39:24 +0800
commitb47445061a00ba7bde7a8edd145a7d109b22d4a7 (patch)
tree074b62fda49d0bf312b22429aa2b32d232ce0216 /src/hs-clientmanager.h
parentd90e4284fc6fc61371c7b31b8cbb9fd99c369636 (diff)
fix segmentation fault error
Change-Id: I3d1124980e10e6f265660226fc9a0749f832a4ff
Diffstat (limited to 'src/hs-clientmanager.h')
-rw-r--r--src/hs-clientmanager.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/hs-clientmanager.h b/src/hs-clientmanager.h
index 4cb1fad..9e58e64 100644
--- a/src/hs-clientmanager.h
+++ b/src/hs-clientmanager.h
@@ -26,7 +26,6 @@
#include "hs-helper.h"
#include "hs-client.h"
-extern const std::string _listen_all;
class listener_interface {
public:
@@ -34,9 +33,9 @@ public:
virtual ~listener_interface() {}
virtual void notify(afb_api_t api, std::string appid = "") = 0;
std::string myUid(void) {return m_uid;}
- std::set<std::string> listenAppSet(void) {return m_listen_appid;}
- void addListenAppId(std::string appid) {m_listen_appid.insert(appid);}
- bool isListenAppId(std::string &appid) {
+ void addListenAppId(const std::string &appid) {m_listen_appid.insert(appid);}
+ void removeListenAppId(const std::string &appid) {m_listen_appid.erase(appid);}
+ bool isListenAppId(const std::string &appid) {
auto it = m_listen_appid.find(appid);
return it != m_listen_appid.end() ? true : false;
}
@@ -80,12 +79,11 @@ private:
HS_ClientCtxt* createClientCtxt(afb_req_t req, std::string appid);
HS_Client* addClient(afb_req_t req, std::string appid);
void removeClient(std::string appid);
- bool checkRegisterApp(afb_api_t api, const std::string &appid);
void notifyListener(afb_api_t api, const std::string &appid);
private:
static HS_ClientManager* me;
- std::unordered_map<std::string, std::list<listener_interface*>> listener_list;
+ std::unordered_map<std::string, listener_interface*> listener_list;
std::unordered_map<std::string, HS_Client*> client_list;
std::unordered_map<std::string, HS_ClientCtxt*> appid2ctxt;
std::mutex mtx;