summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2017-05-04 11:55:35 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2017-05-04 11:55:35 +0200
commitc0562698d8e2613e488b320736255e6bbd49cb2c (patch)
treea314dbadba3129c8fb2c229d384a6241b8dcd4ac
parent863a97b989aecce8b52a09168c0668ad40df8e1c (diff)
Eliminate use of AFB_SESSION_CREATE
AFB_SESSION_CREATE is obsolete since a while. Change-Id: I3dc3eb374f0842d7b210a106b72bce2e4c5c1512 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r--src/afb-api-so-v1.c2
-rw-r--r--src/afb-xreq.c12
2 files changed, 2 insertions, 12 deletions
diff --git a/src/afb-api-so-v1.c b/src/afb-api-so-v1.c
index 4bfd8d99..a81ec17c 100644
--- a/src/afb-api-so-v1.c
+++ b/src/afb-api-so-v1.c
@@ -154,8 +154,6 @@ struct json_object *describe_cb(void *closure)
a = json_object_new_array();
json_object_object_add(f, "name", json_object_new_string(verb->name));
json_object_object_add(f, "info", json_object_new_string(verb->info));
- if (verb->session & AFB_SESSION_CREATE)
- json_object_array_add(a, json_object_new_string("session-create"));
if (verb->session & AFB_SESSION_CLOSE)
json_object_array_add(a, json_object_new_string("session-close"));
if (verb->session & AFB_SESSION_RENEW)
diff --git a/src/afb-xreq.c b/src/afb-xreq.c
index b54b4365..143048c2 100644
--- a/src/afb-xreq.c
+++ b/src/afb-xreq.c
@@ -443,7 +443,7 @@ int xreq_session_check(struct afb_xreq *xreq, int sessionflags)
{
int loa;
- if ((sessionflags & (AFB_SESSION_CREATE|AFB_SESSION_CLOSE|AFB_SESSION_RENEW|AFB_SESSION_CHECK|AFB_SESSION_LOA_EQ)) != 0) {
+ if ((sessionflags & (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");
@@ -452,14 +452,6 @@ int xreq_session_check(struct afb_xreq *xreq, int sessionflags)
}
}
- if ((sessionflags & AFB_SESSION_CREATE) != 0) {
- if (afb_context_check_loa(&xreq->context, 1)) {
- afb_xreq_fail_f(xreq, "failed", "invalid creation state");
- errno = EINVAL;
- return -1;
- }
- }
-
if ((sessionflags & AFB_SESSION_LOA_GE) != 0) {
loa = (sessionflags >> AFB_SESSION_LOA_SHIFT) & AFB_SESSION_LOA_MASK;
if (!afb_context_check_loa(&xreq->context, loa)) {
@@ -483,7 +475,7 @@ int xreq_session_check(struct afb_xreq *xreq, int sessionflags)
void xreq_session_apply(struct afb_xreq *xreq, int sessionflags)
{
- if ((sessionflags & (AFB_SESSION_CREATE | AFB_SESSION_RENEW)) != 0) {
+ if ((sessionflags & AFB_SESSION_RENEW) != 0) {
afb_context_refresh(&xreq->context);
}
if ((sessionflags & AFB_SESSION_CLOSE) != 0) {