-static void req_hook_subcall(void *closure, const char *api, const char *verb, struct json_object *args, void (*callback)(void*, int, struct json_object*), void *cb_closure)
-{
- struct afb_hook_req *tr = closure;
- struct hook_subcall *sc;
-
- TRACE_REQ(subcall, tr, api, verb, args);
- sc = malloc(sizeof *sc);
- if (sc) {
- sc->tr = tr;
- sc->callback = callback;
- sc->cb_closure = cb_closure;
- hook_req_addref(tr);
- cb_closure = sc;
- callback = req_hook_subcall_result;
- }
- afb_req_subcall(tr->req, api, verb, args, callback, cb_closure);
-}
-
-static struct afb_req_itf req_hook_itf = {
- .json = req_hook_json,
- .get = req_hook_get,
- .success = req_hook_success,
- .fail = req_hook_fail,
- .raw = req_hook_raw,
- .send = req_hook_send,
- .context_get = req_hook_context_get,
- .context_set = req_hook_context_set,
- .addref = req_hook_addref,
- .unref = req_hook_unref,
- .session_close = req_hook_session_close,
- .session_set_LOA = req_hook_session_set_LOA,
- .subscribe = req_hook_subscribe,
- .unsubscribe = req_hook_unsubscribe,
- .subcall = req_hook_subcall
-};
-