X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fmain-afs-supervisor.c;h=6daaf64912dc7f6aceaccc1c2b0476a121f45b6d;hb=bc8929bec96e81a7f487d5689f52335b435f0e3e;hp=14f1c3b00d76ff901039198f79e92a5e3747284e;hpb=4521c1e7ae5371ab9d639adc617d17fb4e8ded0c;p=src%2Fapp-framework-binder.git diff --git a/src/main-afs-supervisor.c b/src/main-afs-supervisor.c index 14f1c3b0..6daaf649 100644 --- a/src/main-afs-supervisor.c +++ b/src/main-afs-supervisor.c @@ -40,6 +40,10 @@ #include "jobs.h" #include "process-name.h" +#if !defined(DEFAULT_SUPERVISOR_INTERFACE) +# define DEFAULT_SUPERVISOR_INTERFACE NULL +#endif + /* the main config */ struct afs_config *main_config; @@ -99,13 +103,20 @@ static struct afb_hsrv *start_http_server() NOTICE("Waiting port=%d rootdir=%s", main_config->httpdPort, main_config->rootdir); NOTICE("Browser URL= http://localhost:%d", main_config->httpdPort); - rc = afb_hsrv_start(hsrv, (uint16_t) main_config->httpdPort, 15); + rc = afb_hsrv_start(hsrv, 15); if (!rc) { ERROR("starting of httpd failed"); afb_hsrv_put(hsrv); return NULL; } + rc = afb_hsrv_add_interface_tcp(hsrv, DEFAULT_SUPERVISOR_INTERFACE, (uint16_t) main_config->httpdPort); + if (!rc) { + ERROR("setting interface failed"); + afb_hsrv_put(hsrv); + return NULL; + } + return hsrv; } @@ -160,7 +171,7 @@ static void start(int signum, void *arg) } /* start the services */ - if (afb_apiset_start_all_services(main_apiset, 1) < 0) + if (afb_apiset_start_all_services(main_apiset) < 0) goto error; /* start the HTTP server */