- if (!clientCtx->token[0] || 0 == strcmp (token, clientCtx->token)) {
- clientCtx->created = 1; /* creates by default */
- return 1;
- }
+ if (clientCtx->token[0] && (length >= sizeof(clientCtx->token) || strncmp (token, clientCtx->token, length) || clientCtx->token[length]))
+ return 0;
+
+ clientCtx->created = 1; /* creates by default */
+ return 1;
+}
+
+// Sample Generic Ping Debug API
+int ctxTokenCheck (struct AFB_clientCtx *clientCtx, const char *token)
+{
+ assert(clientCtx != NULL);
+ assert(token != NULL);