X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fmain.c;h=be1927e30dcbe685c267b27a79679a5c04da4760;hb=f1b901ed676b2d45ec8e6ae3d6ef2f94d79f9ee6;hp=e899739c8c8ec0548b2314381446c57ac13eed0a;hpb=abbe8f79355cc7aa2ef906c626c1a43ea4762d88;p=src%2Fapp-framework-binder.git diff --git a/src/main.c b/src/main.c index e899739c..be1927e3 100644 --- a/src/main.c +++ b/src/main.c @@ -32,14 +32,18 @@ #include #include +#include + #include "afb-config.h" #include "afb-hswitch.h" +#include "afb-apis.h" #include "afb-api-so.h" #include "afb-hsrv.h" +#include "afb-context.h" #include "afb-hreq.h" #include "session.h" #include "verbose.h" -#include "utils-upoll.h" +#include "afb-common.h" #include "afb-plugin.h" @@ -558,6 +562,7 @@ static struct afb_hsrv *start_http_server(struct afb_config * config) int main(int argc, char *argv[]) { struct afb_hsrv *hsrv; struct afb_config *config; + struct sd_event *eventloop; // open syslog if ever needed openlog("afb-daemon", 0, LOG_DAEMON); @@ -577,7 +582,7 @@ int main(int argc, char *argv[]) { if (config->ldpaths) afb_api_so_add_pathset(config->ldpaths); - ctxStoreInit(CTX_NBCLIENTS, config->cntxTimeout, config->token); + ctxStoreInit(CTX_NBCLIENTS, config->cntxTimeout, config->token, afb_apis_count()); if (!afb_hreq_init_cookie(config->httpdPort, config->rootapi, DEFLT_CNTX_TIMEOUT)) { fprintf (stderr, "ERR: initialisation of cookies failed\n"); exit (1); @@ -622,8 +627,9 @@ int main(int argc, char *argv[]) { } // infinite loop + eventloop = afb_common_get_event_loop(); for(;;) - upoll_wait(30000); + sd_event_run(eventloop, 30000000); if (verbosity) fprintf (stderr, "hoops returned from infinite loop [report bug]\n");