X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-xreq.c;h=87e01559c982fe6d4c394b42e2527f094a1996dc;hb=82bc93447bcf4bdb4c3835a2d7b1aae2240b5ac1;hp=b64cefbe3be97b8851e7e02c1fa8a55bf9d87411;hpb=c4b603b2b28aec3ae58ce5e9500b07a1382d08f9;p=src%2Fapp-framework-binder.git diff --git a/src/afb-xreq.c b/src/afb-xreq.c index b64cefbe..87e01559 100644 --- a/src/afb-xreq.c +++ b/src/afb-xreq.c @@ -292,9 +292,9 @@ void afb_xreq_fail_f(struct afb_xreq *xreq, const char *status, const char *info free(message); } -static int xcheck(struct afb_xreq *xreq, int stag) +static int xcheck(struct afb_xreq *xreq, int sessionflags) { - if ((stag & (AFB_SESSION_CREATE|AFB_SESSION_CLOSE|AFB_SESSION_RENEW|AFB_SESSION_CHECK|AFB_SESSION_LOA_EQ)) != 0) { + if ((sessionflags & (AFB_SESSION_CREATE|AFB_SESSION_CLOSE|AFB_SESSION_RENEW|AFB_SESSION_CHECK|AFB_SESSION_LOA_EQ)) != 0) { if (!afb_context_check(&xreq->context)) { afb_context_close(&xreq->context); afb_xreq_fail_f(xreq, "failed", "invalid token's identity"); @@ -302,7 +302,7 @@ static int xcheck(struct afb_xreq *xreq, int stag) } } - if ((stag & AFB_SESSION_CREATE) != 0) { + if ((sessionflags & AFB_SESSION_CREATE) != 0) { if (afb_context_check_loa(&xreq->context, 1)) { afb_xreq_fail_f(xreq, "failed", "invalid creation state"); return 0; @@ -311,24 +311,24 @@ static int xcheck(struct afb_xreq *xreq, int stag) afb_context_refresh(&xreq->context); } - if ((stag & (AFB_SESSION_CREATE | AFB_SESSION_RENEW)) != 0) + if ((sessionflags & (AFB_SESSION_CREATE | AFB_SESSION_RENEW)) != 0) afb_context_refresh(&xreq->context); - if ((stag & AFB_SESSION_CLOSE) != 0) { + if ((sessionflags & AFB_SESSION_CLOSE) != 0) { afb_context_change_loa(&xreq->context, 0); afb_context_close(&xreq->context); } - if ((stag & AFB_SESSION_LOA_GE) != 0) { - int loa = (stag >> AFB_SESSION_LOA_SHIFT) & AFB_SESSION_LOA_MASK; + if ((sessionflags & AFB_SESSION_LOA_GE) != 0) { + int loa = (sessionflags >> AFB_SESSION_LOA_SHIFT) & AFB_SESSION_LOA_MASK; if (!afb_context_check_loa(&xreq->context, loa)) { afb_xreq_fail_f(xreq, "failed", "invalid LOA"); return 0; } } - if ((stag & AFB_SESSION_LOA_LE) != 0) { - int loa = (stag >> AFB_SESSION_LOA_SHIFT) & AFB_SESSION_LOA_MASK; + if ((sessionflags & AFB_SESSION_LOA_LE) != 0) { + int loa = (sessionflags >> AFB_SESSION_LOA_SHIFT) & AFB_SESSION_LOA_MASK; if (afb_context_check_loa(&xreq->context, loa + 1)) { afb_xreq_fail_f(xreq, "failed", "invalid LOA"); return 0; @@ -337,9 +337,9 @@ static int xcheck(struct afb_xreq *xreq, int stag) return 1; } -void afb_xreq_call(struct afb_xreq *xreq, int sessionflags, void (*callback)(struct afb_req req)) +void afb_xreq_call(struct afb_xreq *xreq, int sessionflags, void (*method)(struct afb_req req)) { if (xcheck(xreq, sessionflags)) - callback((struct afb_req){ .itf = &xreq_itf, .closure = xreq }); + method((struct afb_req){ .itf = &xreq_itf, .closure = xreq }); }