summaryrefslogtreecommitdiff
path: root/src/medsrv/main.c
diff options
context:
space:
mode:
authorRene Mayrhofer <rene@mayrhofer.eu.org>2010-02-23 10:42:46 +0000
committerRene Mayrhofer <rene@mayrhofer.eu.org>2010-02-23 10:42:46 +0000
commitde6b12502cdf42d5d92118f1c0e38dc31becf7c5 (patch)
tree0edac9c79f5a43e01913dd7f71c7abc487e5727b /src/medsrv/main.c
parent172642669d4a23e17f1ed411fbc8629dcaa5fb46 (diff)
downloadvyos-strongswan-de6b12502cdf42d5d92118f1c0e38dc31becf7c5.tar.gz
vyos-strongswan-de6b12502cdf42d5d92118f1c0e38dc31becf7c5.zip
Updated to new upstream release. interfaces Patch is not from upstream.
Diffstat (limited to 'src/medsrv/main.c')
-rw-r--r--src/medsrv/main.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/medsrv/main.c b/src/medsrv/main.c
index 20dec9d37..1f43a7e17 100644
--- a/src/medsrv/main.c
+++ b/src/medsrv/main.c
@@ -32,11 +32,14 @@ int main(int arc, char *argv[])
bool debug;
char *uri;
int timeout, threads;
-
- library_init(STRONGSWAN_CONF);
- lib->plugins->load(lib->plugins, IPSEC_PLUGINDIR,
- lib->settings->get_str(lib->settings, "medsrv.load", PLUGINS));
-
+
+ library_init(NULL);
+ if (!lib->plugins->load(lib->plugins, NULL,
+ lib->settings->get_str(lib->settings, "medsrv.load", PLUGINS)))
+ {
+ return 1;
+ }
+
socket = lib->settings->get_str(lib->settings, "medsrv.socket", NULL);
debug = lib->settings->get_bool(lib->settings, "medsrv.debug", FALSE);
timeout = lib->settings->get_time(lib->settings, "medsrv.timeout", 900);
@@ -47,14 +50,14 @@ int main(int arc, char *argv[])
fprintf(stderr, "database URI medsrv.database not defined.\n");
return 1;
}
-
+
db = lib->db->create(lib->db, uri);
if (db == NULL)
{
fprintf(stderr, "opening database failed.\n");
return 1;
}
-
+
dispatcher = dispatcher_create(socket, debug, timeout,
(context_constructor_t)user_create, db);
dispatcher->add_filter(dispatcher,
@@ -63,13 +66,13 @@ int main(int arc, char *argv[])
(controller_constructor_t)user_controller_create, db);
dispatcher->add_controller(dispatcher,
(controller_constructor_t)peer_controller_create, db);
-
+
dispatcher->run(dispatcher, threads);
-
+
dispatcher->waitsignal(dispatcher);
dispatcher->destroy(dispatcher);
db->destroy(db);
-
+
library_deinit();
return 0;
}