From: José Bollo Date: Wed, 23 Mar 2016 15:45:19 +0000 (+0100) Subject: session: moves initialisation to main X-Git-Tag: blowfish_2.0.1~250 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=80437693983321d32f20b6324128d441c5fccc49;p=src%2Fapp-framework-binder.git session: moves initialisation to main Change-Id: I038d5624dc2f32e2c2d54b7e6ea388cb61122ccd Signed-off-by: José Bollo --- diff --git a/src/http-svc.c b/src/http-svc.c index 99c4142a..480925db 100644 --- a/src/http-svc.c +++ b/src/http-svc.c @@ -325,9 +325,6 @@ AFB_error httpdStart(AFB_session * session) return AFB_FATAL; } - /* Initialise Client Session Hash Table */ - ctxStoreInit(CTX_NBCLIENTS); - #if defined(USE_MAGIC_MIME_TYPE) /*TBD open libmagic cache [fail to pass EFENCE check (allocating 0 bytes)] */ init_lib_magic (session); diff --git a/src/main.c b/src/main.c index f73cfac0..e9cddcb5 100644 --- a/src/main.c +++ b/src/main.c @@ -503,8 +503,6 @@ int main(int argc, char *argv[]) { on_exit(closeSession, session); parse_arguments(argc, argv, session); - initPlugins(session); - // ------------------ sanity check ---------------------------------------- if ((session->background) && (session->foreground)) { fprintf (stderr, "ERR: cannot select foreground & background at the same time\n"); @@ -515,6 +513,9 @@ int main(int argc, char *argv[]) { exit (1); } + initPlugins(session); + ctxStoreInit(CTX_NBCLIENTS); + // ------------------ Some useful default values ------------------------- if ((session->background == 0) && (session->foreground == 0)) session->foreground=1; diff --git a/src/session.c b/src/session.c index 9d03d0a7..3b9288f8 100644 --- a/src/session.c +++ b/src/session.c @@ -343,7 +343,7 @@ PUBLIC void ctxStoreInit (int nbSession) { // let's create as store as hashtable does not have any sessions.store = calloc (1 + (unsigned)nbSession, sizeof(AFB_clientCtx)); - sessions.max=nbSession; + sessions.max = nbSession; } STATIC AFB_clientCtx *ctxStoreSearch (const char* uuid) {