X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-api-ws.c;h=0022d52668045f0a192b3e8b2fed8c8ce8dec8fa;hb=b355a2a65511c32aaaddf289d70395f872bd4b26;hp=dba8d05b446ff0d9ce6f2be123f24dafe9a1e10f;hpb=69d7968b9713dafa23268ee34516e50133ca8b36;p=src%2Fapp-framework-binder.git diff --git a/src/afb-api-ws.c b/src/afb-api-ws.c index dba8d05b..0022d526 100644 --- a/src/afb-api-ws.c +++ b/src/afb-api-ws.c @@ -226,9 +226,14 @@ int afb_api_ws_add_client(const char *path, struct afb_apiset *apiset) ERROR("can't setup client ws service to %s", apiws->path); goto error3; } + if (afb_stub_ws_client_add(stubws, apiset) < 0) { + ERROR("can't add the client to the apiset for service %s", apiws->path); + goto error4; + } free(apiws); return 0; - +error4: + afb_stub_ws_unref(stubws); error3: close(apiws->fd); error2: @@ -319,6 +324,12 @@ int afb_api_ws_add_server(const char *path, struct afb_apiset *apiset) if (apiws == NULL) goto error; + /* check api name */ + if (!afb_apiset_lookup(apiset, apiws->api, 1)) { + ERROR("Can't provide ws-server for %s: API %s doesn't exist", path, apiws->api); + goto error2; + } + /* connect for serving */ rc = api_ws_server_connect(apiws); if (rc < 0)