diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2012-02-22 10:52:42 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2012-02-22 10:52:42 +0000 |
commit | 87b76a67c1c683ba424c236ee61c6829112d4b88 (patch) | |
tree | 428c28fd8316d4000f221b89ab8dfdbc46e9a3bf /src | |
parent | f72df56543cfcd06df55f9f8e89b752013cc7bf6 (diff) | |
download | gnunet-87b76a67c1c683ba424c236ee61c6829112d4b88.tar.gz gnunet-87b76a67c1c683ba424c236ee61c6829112d4b88.zip |
- changes
Diffstat (limited to 'src')
-rw-r--r-- | src/namestore/gnunet-service-namestore.c | 10 | ||||
-rw-r--r-- | src/namestore/namestore_api.c | 20 | ||||
-rw-r--r-- | src/namestore/test_namestore_api.c | 2 | ||||
-rw-r--r-- | 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 @@ | |||
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 | ||
45 | static 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 | |||
137 | static void | 137 | static void |
138 | force_reconnect (struct GNUNET_NAMESTORE_Handle *nsh); | 138 | force_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 | */ | ||
146 | static void | ||
147 | do_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 | */ | ||
186 | static void | ||
187 | do_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 | ||
32 | static int res; | 32 | static int res; |
33 | 33 | ||
34 | |||
34 | static void | 35 | static void |
35 | run (void *cls, char *const *args, const char *cfgfile, | 36 | run (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] | ||
2 | PORT = 12000 | ||
3 | DEFAULTSERVICES = namestore | ||
4 | UNIXPATH = /tmp/gnunet-p1-service-arm.sock | ||
5 | |||
1 | [namestore] | 6 | [namestore] |
2 | AUTOSTART = YES | 7 | AUTOSTART = YES |
3 | UNIXPATH = /tmp/gnunet-service-namestore.sock | 8 | UNIXPATH = /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 | |||