// Free context [XXXX Should be protected again memory abort XXXX]
static void ctxUuidFreeCB (AFB_clientCtx *client)
{
// Free context [XXXX Should be protected again memory abort XXXX]
static void ctxUuidFreeCB (AFB_clientCtx *client)
{
if (client->contexts[idx] != NULL) {
afb_apis_free_context(idx, client->contexts[idx]);
}
if (client->contexts[idx] != NULL) {
afb_apis_free_context(idx, client->contexts[idx]);
}
{
// let's create as store as hashtable does not have any
sessions.store = calloc (1 + (unsigned)nbSession, sizeof(AFB_clientCtx));
sessions.max = nbSession;
{
// let's create as store as hashtable does not have any
sessions.store = calloc (1 + (unsigned)nbSession, sizeof(AFB_clientCtx));
sessions.max = nbSession;
// we have no session let's create one otherwise let's clean any exiting values
if (clientCtx == NULL) {
clientCtx = calloc(1, sizeof(AFB_clientCtx)); // init NULL clientContext
// we have no session let's create one otherwise let's clean any exiting values
if (clientCtx == NULL) {
clientCtx = calloc(1, sizeof(AFB_clientCtx)); // init NULL clientContext
}
uuid_generate(newuuid); // create a new UUID
uuid_unparse_lower(newuuid, clientCtx->uuid);
// if table is full at 50% let's clean it up
}
uuid_generate(newuuid); // create a new UUID
uuid_unparse_lower(newuuid, clientCtx->uuid);
// if table is full at 50% let's clean it up
- if ((0 == strcmp (token, clientCtx->token)) && (!ctxStoreTooOld (clientCtx, request->config->cntxTimeout))) {
+ if ((0 == strcmp (token, clientCtx->token)) && (!ctxStoreTooOld (clientCtx, sessions.timeout))) {