X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-api-so-v1.c;h=985a113da47139bc95ca9821c8d8e71c144b8428;hb=a708fcbcb234af8ffe69d04786e44472b45f3559;hp=b885cf72f233dfeace950b5c7a237b028eae2c84;hpb=91b744a510bbf41526f0931df2320379bec87c38;p=src%2Fapp-framework-binder.git diff --git a/src/afb-api-so-v1.c b/src/afb-api-so-v1.c index b885cf72..985a113d 100644 --- a/src/afb-api-so-v1.c +++ b/src/afb-api-so-v1.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016, 2017 "IoT.bzh" + * Copyright (C) 2016, 2017, 2018 "IoT.bzh" * Author José Bollo * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -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"); @@ -238,7 +239,7 @@ int afb_api_so_v1_add(const char *path, void *handle, struct afb_apiset *apiset) 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; } @@ -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;