From 9d837229d3ed0442f7254f90f031acc84f3fd2a6 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 21 Oct 2009 21:38:56 +0000 Subject: [PATCH] fix --- src/datastore/Makefile.am | 2 +- src/datastore/gnunet-service-datastore.c | 4 ++++ src/datastore/plugin_datastore_sqlite.c | 4 ---- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/datastore/Makefile.am b/src/datastore/Makefile.am index 608fb7770..e4de8fcfa 100644 --- a/src/datastore/Makefile.am +++ b/src/datastore/Makefile.am @@ -31,6 +31,7 @@ bin_PROGRAMS = \ gnunet_service_datastore_SOURCES = \ gnunet-service-datastore.c plugin_datastore.h gnunet_service_datastore_LDADD = \ + $(top_builddir)/src/arm/libgnunetarm.la \ $(top_builddir)/src/util/libgnunetutil.la \ $(GN_LIBINTL) @@ -44,7 +45,6 @@ libgnunet_plugin_datastore_sqlite_la_SOURCES = \ plugin_datastore_sqlite.c libgnunet_plugin_datastore_sqlite_la_LIBADD = \ $(top_builddir)/src/statistics/libgnunetstatistics.la \ - $(top_builddir)/src/arm/libgnunetarm.la \ $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lsqlite3 libgnunet_plugin_datastore_sqlite_la_LDFLAGS = \ $(GN_PLUGIN_LDFLAGS) diff --git a/src/datastore/gnunet-service-datastore.c b/src/datastore/gnunet-service-datastore.c index c895bb1c8..5944640c4 100644 --- a/src/datastore/gnunet-service-datastore.c +++ b/src/datastore/gnunet-service-datastore.c @@ -26,6 +26,7 @@ #include "platform.h" #include "gnunet_util_lib.h" +#include "gnunet_arm_service.h" #include "gnunet_protocols.h" #include "plugin_datastore.h" #include "datastore.h" @@ -1208,6 +1209,7 @@ cleaning_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) GNUNET_CONTAINER_bloomfilter_free (filter); filter = NULL; } + GNUNET_ARM_stop_services (cfg, tc->sched, "statistics", NULL); } @@ -1305,11 +1307,13 @@ run (void *cls, _("Failed to initialize bloomfilter.\n")); return; } + GNUNET_ARM_start_services (cfg, sched, "statistics", NULL); plugin = load_plugin (); if (NULL == plugin) { GNUNET_CONTAINER_bloomfilter_free (filter); filter = NULL; + GNUNET_ARM_stop_services (cfg, sched, "statistics", NULL); return; } GNUNET_SERVER_disconnect_notify (server, &cleanup_reservations, NULL); diff --git a/src/datastore/plugin_datastore_sqlite.c b/src/datastore/plugin_datastore_sqlite.c index 2e8b53e21..57ff6266f 100644 --- a/src/datastore/plugin_datastore_sqlite.c +++ b/src/datastore/plugin_datastore_sqlite.c @@ -25,7 +25,6 @@ */ #include "platform.h" -#include "gnunet_arm_service.h" #include "gnunet_statistics_service.h" #include "plugin_datastore.h" #include @@ -1580,7 +1579,6 @@ libgnunet_plugin_datastore_sqlite_init (void *cls) return NULL; /* can only initialize once! */ memset (&plugin, 0, sizeof(struct Plugin)); plugin.env = env; - GNUNET_ARM_start_services (env->cfg, env->sched, "statistics", NULL); plugin.statistics = GNUNET_STATISTICS_create (env->sched, "sqlite", env->cfg); @@ -1595,7 +1593,6 @@ libgnunet_plugin_datastore_sqlite_init (void *cls) database_setup (env->cfg, &plugin)) { database_shutdown (&plugin); - GNUNET_ARM_stop_services (env->cfg, env->sched, "statistics", NULL); return NULL; } api = GNUNET_malloc (sizeof (struct GNUNET_DATASTORE_PluginFunctions)); @@ -1635,7 +1632,6 @@ libgnunet_plugin_datastore_sqlite_done (void *cls) fn = GNUNET_strdup (plugin->fn); database_shutdown (plugin); GNUNET_STATISTICS_destroy (plugin->statistics); - GNUNET_ARM_stop_services (plugin->env->cfg, plugin->env->sched, "statistics", NULL); plugin->env = NULL; plugin->payload = 0; GNUNET_free (api); -- 2.25.1