Code Review
/
apps
/
agl-service-homescreen.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
| inline |
side by side
Improvement:a client instance only call afb_req_subscribe once
[apps/agl-service-homescreen.git]
/
src
/
hs-client.cpp
diff --git
a/src/hs-client.cpp
b/src/hs-client.cpp
index
26e43bb
..
536ff6e
100644
(file)
--- a/
src/hs-client.cpp
+++ b/
src/hs-client.cpp
@@
-142,7
+142,12
@@
int HS_Client::subscribe(afb_req_t request, const char* event)
auto ip = event_list.find(std::string(event));
if(ip == event_list.end()) {
event_list[std::string(event)] = 0;
+ }
+ if(!subscription) {
ret = afb_req_subscribe(request, my_event);
+ if(ret == 0) {
+ subscription = true;
+ }
}
return ret;
}