From 87b76a67c1c683ba424c236ee61c6829112d4b88 Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Wed, 22 Feb 2012 10:52:42 +0000 Subject: [PATCH] - changes --- src/namestore/gnunet-service-namestore.c | 10 +++++++++- src/namestore/namestore_api.c | 20 +++++++++++--------- src/namestore/test_namestore_api.c | 2 +- src/namestore/test_namestore_api.conf | 7 +++++-- 4 files changed, 26 insertions(+), 13 deletions(-) diff --git a/src/namestore/gnunet-service-namestore.c b/src/namestore/gnunet-service-namestore.c index 8e7946246..5bfda0161 100644 --- a/src/namestore/gnunet-service-namestore.c +++ b/src/namestore/gnunet-service-namestore.c @@ -27,6 +27,7 @@ #include "gnunet_getopt_lib.h" #include "gnunet_service_lib.h" #include "gnunet_namestore_service.h" +#include "namestore.h" /** @@ -41,6 +42,12 @@ cleanup_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) /* FIXME: do clean up here */ } +static void handle_start () +{ + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received `%s' message\n", "START"); + +} + /** * Process template requests. @@ -54,7 +61,8 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, const struct GNUNET_CONFIGURATION_Handle *cfg) { static const struct GNUNET_SERVER_MessageHandler handlers[] = { - /* FIXME: add handlers here! */ + {&handle_start, NULL, + GNUNET_MESSAGE_TYPE_NAMESTORE_START, sizeof (struct StartMessage)}, {NULL, NULL, 0, 0} }; diff --git a/src/namestore/namestore_api.c b/src/namestore/namestore_api.c index 28f304d08..fbe212c44 100644 --- a/src/namestore/namestore_api.c +++ b/src/namestore/namestore_api.c @@ -137,15 +137,6 @@ struct GNUNET_NAMESTORE_SimpleRecord static void force_reconnect (struct GNUNET_NAMESTORE_Handle *nsh); -/** - * Transmit messages from the message queue to the service - * (if there are any, and if we are not already trying). - * - * @param nsh handle to use - */ -static void -do_transmit (struct GNUNET_NAMESTORE_Handle *nsh); - /** * Type of a function to call when we receive a message @@ -185,6 +176,17 @@ process_namestore_message (void *cls, const struct GNUNET_MessageHeader *msg) force_reconnect (nsh); } + +/** + * Transmit messages from the message queue to the service + * (if there are any, and if we are not already trying). + * + * @param nsh handle to use + */ +static void +do_transmit (struct GNUNET_NAMESTORE_Handle *nsh); + + /** * We can now transmit a message to NAMESTORE. Do it. * diff --git a/src/namestore/test_namestore_api.c b/src/namestore/test_namestore_api.c index 16074c7cf..85fbcbfc5 100644 --- a/src/namestore/test_namestore_api.c +++ b/src/namestore/test_namestore_api.c @@ -31,6 +31,7 @@ static struct GNUNET_NAMESTORE_Handle * nsh; static int res; + static void run (void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) @@ -67,7 +68,6 @@ main (int argc, char *argv[]) { int ret; - ret = check (); return ret; diff --git a/src/namestore/test_namestore_api.conf b/src/namestore/test_namestore_api.conf index c73a15498..be93cb962 100644 --- a/src/namestore/test_namestore_api.conf +++ b/src/namestore/test_namestore_api.conf @@ -1,3 +1,8 @@ +[arm] +PORT = 12000 +DEFAULTSERVICES = namestore +UNIXPATH = /tmp/gnunet-p1-service-arm.sock + [namestore] AUTOSTART = YES UNIXPATH = /tmp/gnunet-service-namestore.sock @@ -26,5 +31,3 @@ CONFIG = ~/.my.cnf # HOST = localhost # PORT = 3306 - - -- 2.25.1