/*
- * Copyright (C) 2016, 2017, 2018 "IoT.bzh"
+ * Copyright (C) 2016-2019 "IoT.bzh"
* Author José Bollo <jose.bollo@iot.bzh>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* limitations under the License.
*/
+#if WITH_AFB_HOOK && WITH_AFB_TRACE
+
#define _GNU_SOURCE
#include <assert.h>
/* struct for tags */
struct tag {
struct tag *next; /* link to the next */
- char tag[1]; /* name of the tag */
+ char tag[]; /* name of the tag */
};
/* struct for events */
hook_session(closure, hookid, session, "destroy", NULL);
}
-static void hook_session_renew(void *closure, const struct afb_hookid *hookid, struct afb_session *session)
-{
- hook_session(closure, hookid, session, "renew", "{ss}", "token", afb_session_token(session));
-}
-
static void hook_session_addref(void *closure, const struct afb_hookid *hookid, struct afb_session *session)
{
hook_session(closure, hookid, session, "addref", NULL);
.hook_session_create = hook_session_create,
.hook_session_close = hook_session_close,
.hook_session_destroy = hook_session_destroy,
- .hook_session_renew = hook_session_renew,
.hook_session_addref = hook_session_addref,
.hook_session_unref = hook_session_unref
};
if (!tag && alloc) {
/* creation if needed */
- tag = malloc(sizeof * tag + strlen(name));
+ tag = malloc(sizeof * tag + 1 + strlen(name));
if (tag) {
strcpy(tag->tag, name);
tag->next = trace->tags;
free(context.errors);
return -1;
}
+
+#endif