int i;
const char *name;
- name = xreq->verb;
+ name = xreq->request.verb;
xreq->request.dynapi = (void*)dynapi->export; /* hack: this avoids to export afb_export structure */
/* look first in dyna mic verbs */
.describe = describe_cb
};
-int afb_api_dyn_add(struct afb_apiset *apiset, const char *name, const char *info, int (*preinit)(void*, struct afb_dynapi*), void *closure)
+int afb_api_dyn_add(struct afb_apiset *apiset, const char *name, const char *info, int noconcurrency, int (*preinit)(void*, struct afb_dynapi*), void *closure)
{
int rc;
struct afb_api_dyn *dynapi;
/* records the binding */
afb_api.closure = dynapi;
afb_api.itf = &dyn_api_itf;
- afb_api.group = NULL;
+ afb_api.group = noconcurrency ? dynapi : NULL;
if (afb_apiset_add(apiset, afb_export_apiname(dynapi->export), afb_api) < 0) {
ERROR("dynamic api %s can't be registered to set %s, ABORTING it!",
afb_export_apiname(dynapi->export),
goto error;
}
INFO("binding %s added to set %s", afb_export_apiname(dynapi->export), afb_apiset_name(apiset));
- return 1;
+ return 0;
error:
afb_export_destroy(export);