summaryrefslogtreecommitdiffstats
path: root/ctl-lib/ctl-action.c
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2018-10-02 14:17:41 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-12-13 15:02:55 +0100
commitdbcc5b691545ca2fb425fd0c73cf15fee100d2f4 (patch)
tree2d470f821ce6b601c53e6c32037c154ad25a1c90 /ctl-lib/ctl-action.c
parentd488fe186c5e51ae99c93ed78ffd87c57ac231c6 (diff)
Pass the plugin to action.
Pass the plugin to action using source structure. Plugin pointer is now accessible from anywhere in the plugin callbacks. Clean deprecated function. Change-Id: Idf50728af0b3573a45c4731d4343cf67741b662c Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'ctl-lib/ctl-action.c')
-rw-r--r--ctl-lib/ctl-action.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/ctl-lib/ctl-action.c b/ctl-lib/ctl-action.c
index 4c72105..c1b7123 100644
--- a/ctl-lib/ctl-action.c
+++ b/ctl-lib/ctl-action.c
@@ -106,6 +106,7 @@ int ActionExecOne(CtlSourceT *source, CtlActionT* action, json_object *queryJ) {
#endif
case CTL_TYPE_CB:
+ source->plugin = action->exec.cb.plugin;
err = (*action->exec.cb.callback) (source, action->argsJ, queryJ);
if (err) {
AFB_ApiError(action->api, "ActionExecOne(Callback) uid%s plugin=%s function=%s args=%s", source->uid, action->exec.cb.plugin->uid, action->exec.cb.funcname, json_object_get_string(action->argsJ));