summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
a02a162)
Exporting API after initialization is a simple technic
to avoid interleaving of incoming foreign calls during
initialisation.
Also a tiny fix in jobs.c and afb-socket.c.
Bug-AGL: SPEC-1724
Change-Id: I59596256481c8afcd88755ec303bf7f881b55c12
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
{
#if defined(NO_SYSTEMD_ACTIVATION)
errno = EAFNOSUPPORT;
{
#if defined(NO_SYSTEMD_ACTIVATION)
errno = EAFNOSUPPORT;
#else
return afb_systemd_fds_for(spec);
#endif
#else
return afb_systemd_fds_for(spec);
#endif
job = malloc(sizeof *job);
pthread_mutex_lock(&mutex);
if (!job) {
job = malloc(sizeof *job);
pthread_mutex_lock(&mutex);
if (!job) {
if (traceglob)
afb_hook_create_global(afb_hook_flags_global_from_text(traceglob), NULL, NULL);
if (traceglob)
afb_hook_create_global(afb_hook_flags_global_from_text(traceglob), NULL, NULL);
+ /* load bindings and apis */
afb_debug("start-load");
apiset_start_list("binding", afb_api_so_add_binding, "the binding");
apiset_start_list("ldpaths", afb_api_so_add_pathset_fails, "the binding path set");
apiset_start_list("weak-ldpaths", afb_api_so_add_pathset_nofails, "the weak binding path set");
apiset_start_list("auto-api", afb_autoset_add_any, "the automatic api path set");
afb_debug("start-load");
apiset_start_list("binding", afb_api_so_add_binding, "the binding");
apiset_start_list("ldpaths", afb_api_so_add_pathset_fails, "the binding path set");
apiset_start_list("weak-ldpaths", afb_api_so_add_pathset_nofails, "the weak binding path set");
apiset_start_list("auto-api", afb_autoset_add_any, "the automatic api path set");
- apiset_start_list("ws-server", afb_api_ws_add_server, "the afb-websocket service");
#if defined(WITH_DBUS_TRANSPARENCY)
#if defined(WITH_DBUS_TRANSPARENCY)
- apiset_start_list("dbus-server", afb_api_dbus_add_server, "the afb-dbus service");
apiset_start_list("dbus-client", afb_api_dbus_add_client, "the afb-dbus client");
#endif
apiset_start_list("ws-client", afb_api_ws_add_client_weak, "the afb-websocket client");
apiset_start_list("dbus-client", afb_api_dbus_add_client, "the afb-dbus client");
#endif
apiset_start_list("ws-client", afb_api_ws_add_client_weak, "the afb-websocket client");
if (afb_apiset_start_all_services(main_apiset) < 0)
goto error;
if (afb_apiset_start_all_services(main_apiset) < 0)
goto error;
+ /* export started apis */
+ apiset_start_list("ws-server", afb_api_ws_add_server, "the afb-websocket service");
+#if defined(WITH_DBUS_TRANSPARENCY)
+ apiset_start_list("dbus-server", afb_api_dbus_add_server, "the afb-dbus service");
+#endif
+
/* start the HTTP server */
afb_debug("start-http");
if (!no_httpd) {
/* start the HTTP server */
afb_debug("start-http");
if (!no_httpd) {