]> git.ipfire.org Git - people/ms/strongswan.git/blobdiff - src/libcharon/daemon.c
Merge branch 'ikev1-clean' into ikev1-master
[people/ms/strongswan.git] / src / libcharon / daemon.c
index 343063be529da2ecefbcf454126ee2234c9a3ab6..575627206e8bb14cda82d23dc4226396475c2597 100644 (file)
@@ -111,6 +111,12 @@ static void destroy(private_daemon_t *this)
        }
        DESTROY_IF(this->public.receiver);
        DESTROY_IF(this->public.sender);
+#ifdef ME
+       DESTROY_IF(this->public.connect_manager);
+       DESTROY_IF(this->public.mediation_manager);
+#endif /* ME */
+       /* make sure the cache is clear before unloading plugins */
+       lib->credmgr->flush_cache(lib->credmgr, CERT_ANY);
        /* unload plugins to release threads */
        lib->plugins->unload(lib->plugins);
 #ifdef CAPABILITIES_LIBCAP
@@ -123,10 +129,6 @@ static void destroy(private_daemon_t *this)
        DESTROY_IF(this->public.controller);
        DESTROY_IF(this->public.eap);
        DESTROY_IF(this->public.xauth);
-#ifdef ME
-       DESTROY_IF(this->public.connect_manager);
-       DESTROY_IF(this->public.mediation_manager);
-#endif /* ME */
        DESTROY_IF(this->public.backends);
        DESTROY_IF(this->public.socket);
 
@@ -200,27 +202,6 @@ METHOD(daemon_t, start, void,
                                                                                           DEFAULT_THREADS));
 }
 
-/**
- * Log loaded plugins
- */
-static void print_plugins()
-{
-       char buf[512];
-       int len = 0;
-       enumerator_t *enumerator;
-       plugin_t *plugin;
-
-       buf[0] = '\0';
-       enumerator = lib->plugins->create_plugin_enumerator(lib->plugins);
-       while (len < sizeof(buf) && enumerator->enumerate(enumerator, &plugin, NULL))
-       {
-               len += snprintf(&buf[len], sizeof(buf)-len, "%s ",
-                                               plugin->get_name(plugin));
-       }
-       enumerator->destroy(enumerator);
-       DBG1(DBG_DMN, "loaded plugins: %s", buf);
-}
-
 METHOD(daemon_t, initialize, bool,
        private_daemon_t *this)
 {
@@ -241,8 +222,8 @@ METHOD(daemon_t, initialize, bool,
        {
                return FALSE;
        }
-
-       print_plugins();
+       DBG1(DBG_DMN, "loaded plugins: %s",
+                lib->plugins->loaded_plugins(lib->plugins));
 
        this->public.ike_sa_manager = ike_sa_manager_create();
        if (this->public.ike_sa_manager == NULL)