aboutsummaryrefslogtreecommitdiff
path: root/src/psycstore
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-04-30 08:17:37 +0000
committerChristian Grothoff <christian@grothoff.org>2016-04-30 08:17:37 +0000
commit95f9076a2139f5fb042b944a0658b6cda2fa35db (patch)
treeb0826a2a1dcf812e6b4450fe6b05d47cd53ae49d /src/psycstore
parent7746f68db77b9ca3c4aaca24ab2ce5253461240b (diff)
downloadgnunet-95f9076a2139f5fb042b944a0658b6cda2fa35db.tar.gz
gnunet-95f9076a2139f5fb042b944a0658b6cda2fa35db.zip
implementing new scheduler shutdown semantics
Diffstat (limited to 'src/psycstore')
-rw-r--r--src/psycstore/gnunet-service-psycstore.c12
-rw-r--r--src/psycstore/psycstore_api.c2
-rw-r--r--src/psycstore/test_psycstore.c4
3 files changed, 11 insertions, 7 deletions
diff --git a/src/psycstore/gnunet-service-psycstore.c b/src/psycstore/gnunet-service-psycstore.c
index 737cff422..e02f77714 100644
--- a/src/psycstore/gnunet-service-psycstore.c
+++ b/src/psycstore/gnunet-service-psycstore.c
@@ -946,11 +946,15 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
946 GNUNET_CONFIGURATION_get_value_string (cfg, "psycstore", "database", 946 GNUNET_CONFIGURATION_get_value_string (cfg, "psycstore", "database",
947 &database)) 947 &database))
948 { 948 {
949 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "No database backend configured\n"); 949 GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
950 "psycstore",
951 "database");
950 } 952 }
951 else 953 else
952 { 954 {
953 GNUNET_asprintf (&db_lib_name, "libgnunet_plugin_psycstore_%s", database); 955 GNUNET_asprintf (&db_lib_name,
956 "libgnunet_plugin_psycstore_%s",
957 database);
954 db = GNUNET_PLUGIN_load (db_lib_name, (void *) cfg); 958 db = GNUNET_PLUGIN_load (db_lib_name, (void *) cfg);
955 GNUNET_free (database); 959 GNUNET_free (database);
956 } 960 }
@@ -966,8 +970,8 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
966 stats = GNUNET_STATISTICS_create ("psycstore", cfg); 970 stats = GNUNET_STATISTICS_create ("psycstore", cfg);
967 GNUNET_SERVER_add_handlers (server, handlers); 971 GNUNET_SERVER_add_handlers (server, handlers);
968 nc = GNUNET_SERVER_notification_context_create (server, 1); 972 nc = GNUNET_SERVER_notification_context_create (server, 1);
969 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task, 973 GNUNET_SCHEDULER_add_shutdown (&shutdown_task,
970 NULL); 974 NULL);
971} 975}
972 976
973 977
diff --git a/src/psycstore/psycstore_api.c b/src/psycstore/psycstore_api.c
index b8f00a41c..234218fba 100644
--- a/src/psycstore/psycstore_api.c
+++ b/src/psycstore/psycstore_api.c
@@ -131,7 +131,7 @@ struct GNUNET_PSYCSTORE_Handle
131 /** 131 /**
132 * Task doing exponential back-off trying to reconnect. 132 * Task doing exponential back-off trying to reconnect.
133 */ 133 */
134 struct GNUNET_SCHEDULER_Task * reconnect_task; 134 struct GNUNET_SCHEDULER_Task *reconnect_task;
135 135
136 /** 136 /**
137 * Time for next connect retry. 137 * Time for next connect retry.
diff --git a/src/psycstore/test_psycstore.c b/src/psycstore/test_psycstore.c
index 266ee5c1d..2582cbf3f 100644
--- a/src/psycstore/test_psycstore.c
+++ b/src/psycstore/test_psycstore.c
@@ -54,7 +54,7 @@ static struct GNUNET_PSYCSTORE_OperationHandle *op;
54/** 54/**
55 * Handle for task for timeout termination. 55 * Handle for task for timeout termination.
56 */ 56 */
57static struct GNUNET_SCHEDULER_Task * end_badly_task; 57static struct GNUNET_SCHEDULER_Task *end_badly_task;
58 58
59static struct GNUNET_CRYPTO_EddsaPrivateKey *channel_key; 59static struct GNUNET_CRYPTO_EddsaPrivateKey *channel_key;
60static struct GNUNET_CRYPTO_EcdsaPrivateKey *slave_key; 60static struct GNUNET_CRYPTO_EcdsaPrivateKey *slave_key;
@@ -141,7 +141,7 @@ end_normally (void *cls)
141static void 141static void
142end () 142end ()
143{ 143{
144 if (end_badly_task != NULL) 144 if (NULL != end_badly_task)
145 { 145 {
146 GNUNET_SCHEDULER_cancel (end_badly_task); 146 GNUNET_SCHEDULER_cancel (end_badly_task);
147 end_badly_task = NULL; 147 end_badly_task = NULL;