diff options
author | Marius Vlad <marius.vlad@collabora.com> | 2020-08-17 12:57:07 +0300 |
---|---|---|
committer | Marius Vlad <marius.vlad@collabora.com> | 2020-08-19 16:14:47 +0300 |
commit | f6c6f42502ba2919f23f553239dd8b117440b365 (patch) | |
tree | dc7f88a4ba0bbc111036f61123e6c780331e299f | |
parent | 58eebeba6beb38861add052b9f4641f85906c8f1 (diff) |
hs-clientmanager: Store the appidClientContext directly
Make client related methods public to be able to call them from
other callsites.
Bug-AGL: SPEC-3524
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I7e13b83564bb6e5d49b760c27665b44d09b0ee94
-rw-r--r-- | src/hs-clientmanager.cpp | 4 | ||||
-rw-r--r-- | src/hs-clientmanager.h | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/hs-clientmanager.cpp b/src/hs-clientmanager.cpp index 9b62808..7c2adc5 100644 --- a/src/hs-clientmanager.cpp +++ b/src/hs-clientmanager.cpp @@ -95,6 +95,8 @@ HS_ClientCtxt* HS_ClientManager::createClientCtxt(afb_req_t req, std::string app afb_req_session_set_LOA(req, 1); afb_req_context_set(req, ctxt, cbRemoveClientCtxt); } + + appid2ctxt[appid] = ctxt; return ctxt; } @@ -186,7 +188,7 @@ int HS_ClientManager::handleRequest(afb_req_t request, const char *verb, const c } else { if(!strcasecmp(verb, "subscribe")) { - appid2ctxt[id] = createClientCtxt(request, id); + createClientCtxt(request, id); HS_Client* client = addClient(request, id); ret = client->handleRequest(request, "subscribe"); } diff --git a/src/hs-clientmanager.h b/src/hs-clientmanager.h index 7ca6411..96a15b9 100644 --- a/src/hs-clientmanager.h +++ b/src/hs-clientmanager.h @@ -49,7 +49,6 @@ public: int pushEvent(const char *event, struct json_object *param, std::string appid = ""); void removeClientCtxt(void *data); // don't use, internal only -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); |