X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fmain-afs-supervisor.c;h=b4250831e4cf2eb429ca591a544f32ba9a3dd6dc;hb=043c27c3a8fd323d59e41288b6fd24f0e9bfa9a3;hp=461b0a0f09d0cb5c24878cd02cc7b728509e71cc;hpb=bebb8fa967f3b71b609119b293d2869d56036586;p=src%2Fapp-framework-binder.git diff --git a/src/main-afs-supervisor.c b/src/main-afs-supervisor.c index 461b0a0f..b4250831 100644 --- a/src/main-afs-supervisor.c +++ b/src/main-afs-supervisor.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016, 2017, 2018 "IoT.bzh" + * Copyright (C) 2016-2019 "IoT.bzh" * Author José Bollo * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -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; }