/* hooking flags */
int hookditf;
int hooksvc;
-
+
/* session for service */
struct afb_session *session;
callreq->result = NULL;
callreq->status = 0;
callreq->async = 0;
- afb_xreq_addref(&callreq->xreq);
+ afb_xreq_unhooked_addref(&callreq->xreq); /* avoid early callreq destruction */
rc = jobs_enter(NULL, 0, callreq_sync_enter, callreq);
if (rc >= 0)
rc = callreq->status;
resu = (rc >= 0 || callreq->result) ? callreq->result : afb_msg_json_internal_error();
- afb_xreq_unref(&callreq->xreq);
+ afb_xreq_unhooked_unref(&callreq->xreq);
}
if (result)
*result = resu;
export->apiset = afb_apiset_addref(apiset);
afb_apiset_unref(prvset);
}
-
+
+struct afb_apiset *afb_export_get_apiset(struct afb_export *export)
+{
+ return export->apiset;
+}
+
/*
* Creates a new service
*/
struct afb_binding_v1 *afb_export_register_v1(struct afb_export *export, struct afb_binding_v1 *(*regfun)(const struct afb_binding_interface_v1*))
{
return regfun(&export->export.v1);
-
}
int afb_export_start_v1(struct afb_export *export, int (*start)(struct afb_service))