From 82bc93447bcf4bdb4c3835a2d7b1aae2240b5ac1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Bollo?= Date: Thu, 6 Apr 2017 14:51:08 +0200 Subject: [PATCH] Improve names MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change-Id: Ib7e31b50a725c73e6eaba414c6628524fbcd84f9 Signed-off-by: José Bollo --- src/afb-xreq.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) 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 }); } -- 2.16.6