aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/afb-xreq.c22
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 });
}