aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorFulup Ar Foll <fulup@iot.bzh>2015-12-23 00:55:32 +0100
committerFulup Ar Foll <fulup@iot.bzh>2015-12-23 00:55:32 +0100
commitcf2b7c5be026071b696c62a8b0f260e624c9a357 (patch)
tree5ce7bf615e81da31f1e2b5081bb4829fdcbdcf78 /plugins
parent00857f9da5ae802794a4cb94aca576b11bfe6628 (diff)
Restore Previous functionalities with a unique Token
Diffstat (limited to 'plugins')
-rw-r--r--plugins/session/token-api.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/plugins/session/token-api.c b/plugins/session/token-api.c
index 0a5a2be4..25d0b993 100644
--- a/plugins/session/token-api.c
+++ b/plugins/session/token-api.c
@@ -77,6 +77,16 @@ STATIC json_object* clientContextReset (AFB_request *request) {
// WARNING: if you free context resource manually here do not forget to set request->context=NULL;
return (jresp);
}
+// Close and Free context
+STATIC json_object* clientGetPing (AFB_request *request) {
+ static count=0;
+ json_object *jresp;
+
+ jresp = json_object_new_object();
+ json_object_object_add(jresp, "count", json_object_new_int (count ++));
+
+ return (jresp);
+}
// This function is call when Client Session Context is removed
@@ -87,7 +97,7 @@ STATIC void clientContextFree(void *context, char* uuid) {
}
STATIC AFB_restapi pluginApis[]= {
- {"ping" , AFB_SESSION_NONE , (AFB_apiCB)getPingTest ,"Ping Rest Test Service"},
+ {"ping" , AFB_SESSION_NONE , (AFB_apiCB)clientGetPing ,"Ping Rest Test Service"},
{"create" , AFB_SESSION_CREATE, (AFB_apiCB)clientContextCreate ,"Request Client Context Creation"},
{"refresh" , AFB_SESSION_RENEW , (AFB_apiCB)clientContextRefresh,"Refresh Client Context Token"},
{"check" , AFB_SESSION_CHECK , (AFB_apiCB)clientContextCheck ,"Check Client Context Token"},