aboutsummaryrefslogtreecommitdiff
path: root/src/multicast
diff options
context:
space:
mode:
authorxrs <xrs@mail36.net>2017-03-10 19:30:08 +0100
committerxrs <xrs@mail36.net>2017-03-10 19:30:08 +0100
commit4666ecb93dbc31b8e3b488ce6105202ae089a453 (patch)
tree085a3f2f2ea005089bec2aa4afbcbca515f6b053 /src/multicast
parent20906d422b2918e8afe7bb624bd843ae8bb54c98 (diff)
downloadgnunet-4666ecb93dbc31b8e3b488ce6105202ae089a453.tar.gz
gnunet-4666ecb93dbc31b8e3b488ce6105202ae089a453.zip
test_multicast_2peers: formatting and stuff
Diffstat (limited to 'src/multicast')
-rw-r--r--src/multicast/test_multicast_2peers.c46
1 files changed, 26 insertions, 20 deletions
diff --git a/src/multicast/test_multicast_2peers.c b/src/multicast/test_multicast_2peers.c
index 929637e8e..2f0cedc31 100644
--- a/src/multicast/test_multicast_2peers.c
+++ b/src/multicast/test_multicast_2peers.c
@@ -151,7 +151,6 @@ member_join_decision (void *cls,
151 0, 151 0,
152 notify, 152 notify,
153 NULL); 153 NULL);
154
155 } 154 }
156} 155}
157 156
@@ -159,7 +158,8 @@ static void
159member_message (void *cls, 158member_message (void *cls,
160 const struct GNUNET_MULTICAST_MessageHeader *msg) 159 const struct GNUNET_MULTICAST_MessageHeader *msg)
161{ 160{
162 if (0 != strncmp ("pong", (char *)&msg[1], 4)) { 161 if (0 != strncmp ("pong", (char *)&msg[1], 4))
162 {
163 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "member did not receive pong\n"); 163 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "member did not receive pong\n");
164 result = GNUNET_SYSERR; 164 result = GNUNET_SYSERR;
165 GNUNET_SCHEDULER_shutdown (); 165 GNUNET_SCHEDULER_shutdown ();
@@ -228,9 +228,8 @@ origin_request (void *cls,
228{ 228{
229 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "origin receives: %s\n", (char *)&req[1]); 229 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "origin receives: %s\n", (char *)&req[1]);
230 230
231 if (0 != strncmp ("ping", (char *)&req[1], 4)) { 231 if (0 != strncmp ("ping", (char *)&req[1], 4))
232 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "origin didn't reveice a correct request"); 232 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "origin didn't reveice a correct request");
233 }
234 233
235 GNUNET_MULTICAST_origin_to_all (origin, 234 GNUNET_MULTICAST_origin_to_all (origin,
236 0, 235 0,
@@ -255,10 +254,15 @@ service_connect1 (void *cls,
255{ 254{
256 member = ca_result; 255 member = ca_result;
257 256
258 if (NULL != member) 257 if (NULL != member)
258 {
259 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Connected to multicast service of member\n"); 259 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Connected to multicast service of member\n");
260 }
260 else 261 else
262 {
261 result = GNUNET_SYSERR; 263 result = GNUNET_SYSERR;
264 GNUNET_SCHEDULER_shutdown ();
265 }
262} 266}
263 267
264static void 268static void
@@ -316,7 +320,8 @@ peer_information_cb (void *cls,
316{ 320{
317 int i = (int) (long) cls; 321 int i = (int) (long) cls;
318 322
319 if (NULL == pinfo) { 323 if (NULL == pinfo)
324 {
320 result = GNUNET_SYSERR; 325 result = GNUNET_SYSERR;
321 GNUNET_SCHEDULER_shutdown (); 326 GNUNET_SCHEDULER_shutdown ();
322 } 327 }
@@ -329,20 +334,21 @@ peer_information_cb (void *cls,
329 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 334 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
330 "Create member peer\n"); 335 "Create member peer\n");
331 336
332 if (0 == i) { 337 if (0 == i)
333 /* connect to multicast service of member */ 338 {
334 op1 = GNUNET_TESTBED_service_connect (NULL, /* Closure for operation */ 339 /* connect to multicast service of member */
335 peers[1], /* The peer whose service to connect to */ 340 op1 = GNUNET_TESTBED_service_connect (NULL, /* Closure for operation */
336 "multicast", /* The name of the service */ 341 peers[1], /* The peer whose service to connect to */
337 service_connect1, /* callback to call after a handle to service 342 "multicast", /* The name of the service */
338 is opened */ 343 service_connect1, /* callback to call after a handle to service
339 NULL, /* closure for the above callback */ 344 is opened */
340 multicast_ca1, /* callback to call with peer's configuration; 345 NULL, /* closure for the above callback */
341 this should open the needed service connection */ 346 multicast_ca1, /* callback to call with peer's configuration;
342 multicast_da1, /* callback to be called when closing the 347 this should open the needed service connection */
343 opened service connection */ 348 multicast_da1, /* callback to be called when closing the
344 NULL); /* closure for the above two callbacks */ 349 opened service connection */
345 } 350 NULL); /* closure for the above two callbacks */
351 }
346} 352}
347 353
348/** 354/**