-static inline void lock(struct afb_session *session)
-{
- pthread_mutex_lock(&session->mutex);
-}
-
-static inline void unlock(struct afb_session *session)
-{
- pthread_mutex_unlock(&session->mutex);
-}
-
-// Free context [XXXX Should be protected again memory abort XXXX]
-static void close_session(struct afb_session *session)
-{
- int idx;
- struct cookie *cookie;
-
- /* free cookies */
- for (idx = 0 ; idx < COOKIECOUNT ; idx++) {
- while ((cookie = session->cookies[idx])) {
- session->cookies[idx] = cookie->next;
- if (cookie->freecb != NULL)
- cookie->freecb(cookie->value);
- free(cookie);
- }
- }
-}
-
-/* tiny hash function inspired from pearson */
-static int pearson4(const char *text)
+/*
+ * Returns a tiny hash value for the 'text'.
+ *
+ * Tiny hash function inspired from pearson
+ */
+static uint8_t pearson4(const char *text)