/*
- * Copyright (C) 2016, 2017 "IoT.bzh"
+ * Copyright (C) 2016, 2017, 2018 "IoT.bzh"
* Author José Bollo <jose.bollo@iot.bzh>
*
* Licensed under the Apache License, Version 2.0 (the "License");
const struct afb_verb_desc_v1 *verb;
struct api_so_v1 *desc = closure;
- verb = search(desc, xreq->verb);
+ xreq->request.dynapi = (void*)desc->export; /* hack: this avoids to export afb_export structure */
+ verb = search(desc, xreq->request.verb);
afb_xreq_call_verb_v1(xreq, verb);
}
/* allocates the description */
init = dlsym(handle, afb_api_so_v1_service_init);
onevent = dlsym(handle, afb_api_so_v1_service_event);
- export = afb_export_create_v1(path, init, onevent);
+ export = afb_export_create_v1(apiset, path, init, onevent);
desc = calloc(1, sizeof *desc);
if (desc == NULL || export == NULL) {
ERROR("out of memory");
ERROR("binding [%s] bad prefix...", path);
goto error;
}
- if (!afb_api_is_valid_name(desc->binding->v1.prefix)) {
+ if (!afb_api_is_valid_name(desc->binding->v1.prefix, 1)) {
ERROR("binding [%s] invalid prefix...", path);
goto error;
}