Provide API and VERB name of requests
[src/app-framework-binder.git] / src / afb-api-so-v1.c
index b885cf7..9a9e47a 100644 (file)
@@ -67,7 +67,8 @@ static void call_cb(void *closure, struct afb_xreq *xreq)
        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);
 }
 
@@ -212,7 +213,7 @@ int afb_api_so_v1_add(const char *path, void *handle, struct afb_apiset *apiset)
        /* 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");
@@ -256,7 +257,7 @@ int afb_api_so_v1_add(const char *path, void *handle, struct afb_apiset *apiset)
                afb_export_rename(desc->export, desc->binding->v1.prefix);
        afb_api.closure = desc;
        afb_api.itf = &so_v1_api_itf;
-       afb_api.noconcurrency = 0;
+       afb_api.group = NULL;
        if (afb_apiset_add(apiset, afb_export_apiname(desc->export), afb_api) < 0) {
                ERROR("binding [%s] can't be registered...", path);
                goto error;