aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
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"},