/*
- * 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");
struct api_so_v2 *desc = closure;
const struct afb_verb_v2 *verb;
- 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_v2(xreq, verb);
}
assert(data);
/* allocates the description */
- export = afb_export_create_v2(binding->api, data, binding->init, binding->onevent);
+ export = afb_export_create_v2(apiset, binding->api, data, binding->init, binding->onevent);
desc = calloc(1, sizeof *desc);
if (!desc || !export) {
ERROR("out of memory");
ERROR("binding [%s] bad api name...", path);
goto error;
}
- if (!afb_api_is_valid_name(binding->api)) {
+ if (!afb_api_is_valid_name(binding->api, 1)) {
ERROR("binding [%s] invalid api name...", path);
goto error;
}