aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/afb/afb-req-itf.h13
-rw-r--r--src/afb-hreq.c4
-rw-r--r--src/afb-ws-json1.c4
3 files changed, 19 insertions, 2 deletions
diff --git a/include/afb/afb-req-itf.h b/include/afb/afb-req-itf.h
index a3ff9fe0..6984d0fa 100644
--- a/include/afb/afb-req-itf.h
+++ b/include/afb/afb-req-itf.h
@@ -40,6 +40,9 @@ struct afb_req_itf {
void (*addref)(void *closure);
void (*unref)(void *closure);
+
+ void (*session_close)(void *closure);
+ void (*session_set_LOA)(void *closure, unsigned level);
};
struct afb_req {
@@ -123,6 +126,16 @@ static inline void afb_req_unref(struct afb_req req)
return req.itf->unref(req.closure);
}
+static inline void afb_req_session_close(struct afb_req req)
+{
+ return req.itf->session_close(req.closure);
+}
+
+static inline void afb_req_session_set_LOA(struct afb_req req, unsigned level)
+{
+ return req.itf->session_set_LOA(req.closure, level);
+}
+
#include <stdlib.h>
static inline struct afb_req *afb_req_store(struct afb_req req)
diff --git a/src/afb-hreq.c b/src/afb-hreq.c
index b1f300db..6cd1e225 100644
--- a/src/afb-hreq.c
+++ b/src/afb-hreq.c
@@ -82,7 +82,9 @@ static const struct afb_req_itf afb_hreq_itf = {
.context_get = (void*)afb_context_get,
.context_set = (void*)afb_context_set,
.addref = (void*)afb_hreq_addref,
- .unref = (void*)afb_hreq_unref
+ .unref = (void*)afb_hreq_unref,
+ .session_close = (void*)afb_context_close,
+ .session_set_LOA = (void*)afb_context_change_loa
};
static struct hreq_data *get_data(struct afb_hreq *hreq, const char *key, int create)
diff --git a/src/afb-ws-json1.c b/src/afb-ws-json1.c
index 78b8c210..351a5d09 100644
--- a/src/afb-ws-json1.c
+++ b/src/afb-ws-json1.c
@@ -169,7 +169,9 @@ static const struct afb_req_itf wsreq_itf = {
.context_get = (void*)afb_context_get,
.context_set = (void*)afb_context_set,
.addref = (void*)wsreq_addref,
- .unref = (void*)wsreq_unref
+ .unref = (void*)wsreq_unref,
+ .session_close = (void*)afb_context_close,
+ .session_set_LOA = (void*)afb_context_change_loa
};
static int aws_wsreq_parse(struct afb_wsreq *r, char *text, size_t size)