diff options
author | 2017-09-22 15:17:31 +0200 | |
---|---|---|
committer | 2017-10-09 14:08:33 +0200 | |
commit | 59cd34b59853f6a47e756d7ab5bc0329f40a471c (patch) | |
tree | 8655c0191ac3e1bf5d11236909c2422dcd4cd801 /src/afb-xreq.c | |
parent | 325e6a7f034c80562096d60ab01f2e4532eea98c (diff) |
Allow dynamic creation of APIs
Change-Id: I825bfa7969c98dd214457d9ff94e2948362286a9
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/afb-xreq.c')
-rw-r--r-- | src/afb-xreq.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/afb-xreq.c b/src/afb-xreq.c index 8bfb3639..cbed87f3 100644 --- a/src/afb-xreq.c +++ b/src/afb-xreq.c @@ -34,6 +34,7 @@ #include "afb-cred.h" #include "afb-hook.h" #include "afb-api.h" +#include "afb-api-dyn.h" #include "afb-apiset.h" #include "afb-auth.h" #include "jobs.h" @@ -1039,6 +1040,15 @@ void afb_xreq_call_verb_v2(struct afb_xreq *xreq, const struct afb_verb_v2 *verb verb->callback(to_req(xreq)); } +void afb_xreq_call_verb_vdyn(struct afb_xreq *xreq, const struct afb_api_dyn_verb *verb) +{ + if (!verb) + afb_xreq_fail_unknown_verb(xreq); + else + if (xreq_session_check_apply_v2(xreq, verb->session, verb->auth) >= 0) + verb->callback(to_request(xreq)); +} + void afb_xreq_init(struct afb_xreq *xreq, const struct afb_xreq_query_itf *queryitf) { memset(xreq, 0, sizeof *xreq); |