diff options
author | Jose Bollo <jose.bollo@iot.bzh> | 2019-02-15 13:41:38 +0100 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2019-03-29 14:14:13 +0100 |
commit | a2cf84ecde926adeebf09bc2c284401513d3fab3 (patch) | |
tree | 2aeb893daf240e34ab12a8828f1b3ad9b900422c /src/afb-session.c | |
parent | 5011060f04181acbb18babcc2017a2f0b6cfb853 (diff) |
hooks: Allow to remove hooking (and/or trace)
This change allows to downsize the binder by
removing its internal hooking and tracing features.
Change-Id: Ifb080a7426216f6c6b1c8f8e5bf8ddd52df40a3e
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/afb-session.c')
-rw-r--r-- | src/afb-session.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/afb-session.c b/src/afb-session.c index 19a5ebfc..70e8c3cd 100644 --- a/src/afb-session.c +++ b/src/afb-session.c @@ -240,8 +240,10 @@ static void session_close(struct afb_session *session) /* close it now */ session->closed = 1; +#if WITH_AFB_HOOK /* emit the hook */ afb_hook_session_close(session); +#endif /* release cookies */ for (idx = 0 ; idx < COOKIECOUNT ; idx++) { @@ -258,7 +260,9 @@ static void session_close(struct afb_session *session) /* destroy the 'session' */ static void session_destroy (struct afb_session *session) { +#if WITH_AFB_HOOK afb_hook_session_destroy(session); +#endif pthread_mutex_destroy(&session->mutex); free(session->lang); free(session); @@ -316,7 +320,9 @@ static struct afb_session *session_add(const char *uuid, int timeout, time_t now return NULL; } +#if WITH_AFB_HOOK afb_hook_session_create(session); +#endif return session; } @@ -513,7 +519,9 @@ end: struct afb_session *afb_session_addref(struct afb_session *session) { if (session != NULL) { +#if WITH_AFB_HOOK afb_hook_session_addref(session); +#endif session_lock(session); session->refcount++; session_unlock(session); @@ -527,7 +535,9 @@ void afb_session_unref(struct afb_session *session) if (session == NULL) return; +#if WITH_AFB_HOOK afb_hook_session_unref(session); +#endif session_lock(session); if (!--session->refcount) { if (session->autoclose) @@ -590,7 +600,9 @@ void afb_session_new_token (struct afb_session *session) session_lock(session); new_uuid(session->token); session_update_expiration(session, NOW); +#if WITH_AFB_HOOK afb_hook_session_renew(session); +#endif session_unlock(session); } |