aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2012-02-22 10:52:42 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2012-02-22 10:52:42 +0000
commit87b76a67c1c683ba424c236ee61c6829112d4b88 (patch)
tree428c28fd8316d4000f221b89ab8dfdbc46e9a3bf /src
parentf72df56543cfcd06df55f9f8e89b752013cc7bf6 (diff)
downloadgnunet-87b76a67c1c683ba424c236ee61c6829112d4b88.tar.gz
gnunet-87b76a67c1c683ba424c236ee61c6829112d4b88.zip
- changes
Diffstat (limited to 'src')
-rw-r--r--src/namestore/gnunet-service-namestore.c10
-rw-r--r--src/namestore/namestore_api.c20
-rw-r--r--src/namestore/test_namestore_api.c2
-rw-r--r--src/namestore/test_namestore_api.conf7
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 @@
27#include "gnunet_getopt_lib.h" 27#include "gnunet_getopt_lib.h"
28#include "gnunet_service_lib.h" 28#include "gnunet_service_lib.h"
29#include "gnunet_namestore_service.h" 29#include "gnunet_namestore_service.h"
30#include "namestore.h"
30 31
31 32
32/** 33/**
@@ -41,6 +42,12 @@ cleanup_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
41 /* FIXME: do clean up here */ 42 /* FIXME: do clean up here */
42} 43}
43 44
45static void handle_start ()
46{
47 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received `%s' message\n", "START");
48
49}
50
44 51
45/** 52/**
46 * Process template requests. 53 * Process template requests.
@@ -54,7 +61,8 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
54 const struct GNUNET_CONFIGURATION_Handle *cfg) 61 const struct GNUNET_CONFIGURATION_Handle *cfg)
55{ 62{
56 static const struct GNUNET_SERVER_MessageHandler handlers[] = { 63 static const struct GNUNET_SERVER_MessageHandler handlers[] = {
57 /* FIXME: add handlers here! */ 64 {&handle_start, NULL,
65 GNUNET_MESSAGE_TYPE_NAMESTORE_START, sizeof (struct StartMessage)},
58 {NULL, NULL, 0, 0} 66 {NULL, NULL, 0, 0}
59 }; 67 };
60 68
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
137static void 137static void
138force_reconnect (struct GNUNET_NAMESTORE_Handle *nsh); 138force_reconnect (struct GNUNET_NAMESTORE_Handle *nsh);
139 139
140/**
141 * Transmit messages from the message queue to the service
142 * (if there are any, and if we are not already trying).
143 *
144 * @param nsh handle to use
145 */
146static void
147do_transmit (struct GNUNET_NAMESTORE_Handle *nsh);
148
149 140
150/** 141/**
151 * Type of a function to call when we receive a message 142 * 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)
185 force_reconnect (nsh); 176 force_reconnect (nsh);
186} 177}
187 178
179
180/**
181 * Transmit messages from the message queue to the service
182 * (if there are any, and if we are not already trying).
183 *
184 * @param nsh handle to use
185 */
186static void
187do_transmit (struct GNUNET_NAMESTORE_Handle *nsh);
188
189
188/** 190/**
189 * We can now transmit a message to NAMESTORE. Do it. 191 * We can now transmit a message to NAMESTORE. Do it.
190 * 192 *
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;
31 31
32static int res; 32static int res;
33 33
34
34static void 35static void
35run (void *cls, char *const *args, const char *cfgfile, 36run (void *cls, char *const *args, const char *cfgfile,
36 const struct GNUNET_CONFIGURATION_Handle *cfg) 37 const struct GNUNET_CONFIGURATION_Handle *cfg)
@@ -67,7 +68,6 @@ main (int argc, char *argv[])
67{ 68{
68 int ret; 69 int ret;
69 70
70
71 ret = check (); 71 ret = check ();
72 72
73 return ret; 73 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 @@
1[arm]
2PORT = 12000
3DEFAULTSERVICES = namestore
4UNIXPATH = /tmp/gnunet-p1-service-arm.sock
5
1[namestore] 6[namestore]
2AUTOSTART = YES 7AUTOSTART = YES
3UNIXPATH = /tmp/gnunet-service-namestore.sock 8UNIXPATH = /tmp/gnunet-service-namestore.sock
@@ -26,5 +31,3 @@ CONFIG = ~/.my.cnf
26# HOST = localhost 31# HOST = localhost
27# PORT = 3306 32# PORT = 3306
28 33
29
30