summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2017-04-10 15:19:04 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2017-04-10 15:19:04 +0200
commit5c87873a2134045dcd013d8e55acc4b5ca841131 (patch)
tree816b0fd8c9a00217a2c31b356c47d8f4076c0488
parentdf506d8aeef9ec113c455f3a5f3d471b0a8529e6 (diff)
Refactor of initialisation
Change-Id: Ie5209f74ea1a65571a3ec54724131f15d22ca35f Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r--src/main.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/main.c b/src/main.c
index 0bfa5292..18f5e5ef 100644
--- a/src/main.c
+++ b/src/main.c
@@ -455,28 +455,29 @@ static void start()
goto error;
}
+ /* configure the daemon */
+ afb_apis_set_timeout(config->apiTimeout);
+ afb_session_init(config->nbSessionMax, config->cntxTimeout, config->token);
+ if (!afb_hreq_init_cookie(config->httpdPort, config->rootapi, config->cntxTimeout)) {
+ ERROR("initialisation of cookies failed");
+ goto error;
+ }
+
/* install hooks */
if (config->tracereq)
afb_hook_create_xreq(NULL, NULL, NULL, config->tracereq, NULL, NULL);
if (config->traceditf)
afb_hook_create_ditf(NULL, config->traceditf, NULL, NULL);
- afb_apis_set_timeout(config->apiTimeout);
+ /* load bindings */
start_list(config->dbus_clients, afb_api_dbus_add_client, "the afb-dbus client");
start_list(config->ws_clients, afb_api_ws_add_client, "the afb-websocket client");
start_list(config->ldpaths, afb_api_so_add_pathset, "the binding path set");
start_list(config->so_bindings, afb_api_so_add_binding, "the binding");
- afb_session_init(config->nbSessionMax, config->cntxTimeout, config->token);
-
start_list(config->dbus_servers, afb_api_dbus_add_server, "the afb-dbus service");
start_list(config->ws_servers, afb_api_ws_add_server, "the afb-websocket service");
- if (!afb_hreq_init_cookie(config->httpdPort, config->rootapi, config->cntxTimeout)) {
- ERROR("initialisation of cookies failed");
- goto error;
- }
-
DEBUG("Init config done");
/* start the services */