diff options
author | José Bollo <jose.bollo@iot.bzh> | 2017-04-06 14:51:08 +0200 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2017-04-06 16:26:13 +0200 |
commit | 82bc93447bcf4bdb4c3835a2d7b1aae2240b5ac1 (patch) | |
tree | 329f6b11b9a2f0abc86a6abdfe1ce4a37118b8e1 | |
parent | c4b603b2b28aec3ae58ce5e9500b07a1382d08f9 (diff) |
Improve names
Change-Id: Ib7e31b50a725c73e6eaba414c6628524fbcd84f9
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r-- | src/afb-xreq.c | 22 |
1 files 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 }); } |