summaryrefslogtreecommitdiffstats
path: root/plugins/afm-main-plugin
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2016-05-10 13:47:58 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2016-05-10 13:47:58 +0200
commitf1b901ed676b2d45ec8e6ae3d6ef2f94d79f9ee6 (patch)
treeea91e3f7485736acdd6aa83ffc6e0ff60f326577 /plugins/afm-main-plugin
parent19fb390ec60890d55bafe7a4c887b1453509f7ef (diff)
Refactoring requests and context handling
Also adds a first (untested) implmentation of the afb services over dbus. Change-Id: Id1bdeccf75f3a70d3658bdaf0510d6e7b97f6c32 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'plugins/afm-main-plugin')
-rw-r--r--plugins/afm-main-plugin/afm-main-plugin.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/plugins/afm-main-plugin/afm-main-plugin.c b/plugins/afm-main-plugin/afm-main-plugin.c
index c6408a51..8b26fe7e 100644
--- a/plugins/afm-main-plugin/afm-main-plugin.c
+++ b/plugins/afm-main-plugin/afm-main-plugin.c
@@ -62,6 +62,7 @@ static struct memo *make_memo(struct afb_req request, const char *method)
if (memo != NULL) {
memo->request = request;
memo->method = method;
+ afb_req_addref(request);
}
return memo;
}
@@ -109,6 +110,7 @@ static void embed_call_void_callback(int status, struct json_object *obj, struct
afb_req_success(memo->request, obj, NULL);
}
}
+ afb_req_unref(memo->request);
free(memo);
}
@@ -134,6 +136,7 @@ static void call_appid_callback(int status, struct json_object *obj, struct memo
obj = json_object_get(obj);
afb_req_success(memo->request, obj, NULL);
}
+ afb_req_unref(memo->request);
free(memo);
}