X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-hook.c;h=d5c534d0d1ae189c5d54a85df55224fbe988df6c;hb=13bd63c1bd4055cba1316042267b31c4776af256;hp=c06eb789cf1ea68a5df0d49714d48de6f3fe048f;hpb=d00d1b7ce817aa3fefed9ee59d0904af561bb66c;p=src%2Fapp-framework-binder.git diff --git a/src/afb-hook.c b/src/afb-hook.c index c06eb789..d5c534d0 100644 --- a/src/afb-hook.c +++ b/src/afb-hook.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 "IoT.bzh" + * Copyright (C) 2016, 2017 "IoT.bzh" * Author José Bollo * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -28,7 +28,7 @@ #include "afb-context.h" #include "afb-hook.h" -#include "session.h" +#include "afb-session.h" #include "verbose.h" /* @@ -39,7 +39,7 @@ struct afb_hook { unsigned refcount; /* reference count */ char *api; /* api hooked or NULL for any */ char *verb; /* verb hooked or NULL for any */ - struct AFB_clientCtx *session; /* session hooked or NULL if any */ + struct afb_session *session; /* session hooked or NULL if any */ unsigned flags; /* hook flags */ struct afb_hook_req_itf *reqitf; /* interface of hook */ void *closure; /* closure for callbacks */ @@ -526,7 +526,7 @@ struct afb_req afb_hook_req_call(struct afb_req req, struct afb_context *context return req; } -struct afb_hook *afb_hook_req_create(const char *api, const char *verb, struct AFB_clientCtx *session, unsigned flags, struct afb_hook_req_itf *itf, void *closure) +struct afb_hook *afb_hook_req_create(const char *api, const char *verb, struct afb_session *session, unsigned flags, struct afb_hook_req_itf *itf, void *closure) { struct afb_hook *hook; @@ -536,13 +536,13 @@ struct afb_hook *afb_hook_req_create(const char *api, const char *verb, struct A hook->api = api ? strdup(api) : NULL; hook->verb = verb ? strdup(verb) : NULL; - hook->session = session ? ctxClientAddRef(session) : NULL; + hook->session = session ? afb_session_addref(session) : NULL; if ((api && !hook->api) || (verb && !hook->verb)) { free(hook->api); free(hook->verb); if (hook->session) - ctxClientUnref(hook->session); + afb_session_unref(hook->session); free(hook); return NULL; } @@ -577,7 +577,7 @@ void afb_hook_unref(struct afb_hook *hook) free(hook->api); free(hook->verb); if (hook->session) - ctxClientUnref(hook->session); + afb_session_unref(hook->session); free(hook); } }