aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2014-06-23 11:29:37 +0000
committerChristian Grothoff <christian@grothoff.org>2014-06-23 11:29:37 +0000
commitb5582e492a12b2ef17c1daff0707cc0b3197aeca (patch)
treec79bf269a431643eb925eaeb4d9fb99ad6765f28 /src
parentfd512b7696978adc5241f83092756afbdfcfd1af (diff)
downloadgnunet-b5582e492a12b2ef17c1daff0707cc0b3197aeca.tar.gz
gnunet-b5582e492a12b2ef17c1daff0707cc0b3197aeca.zip
-indenting
Diffstat (limited to 'src')
-rw-r--r--src/transport/test_transport_api_monitoring.c56
1 files changed, 36 insertions, 20 deletions
diff --git a/src/transport/test_transport_api_monitoring.c b/src/transport/test_transport_api_monitoring.c
index 221d588ad..51ec38d79 100644
--- a/src/transport/test_transport_api_monitoring.c
+++ b/src/transport/test_transport_api_monitoring.c
@@ -88,11 +88,12 @@ static int p1_c_notify = GNUNET_NO;
88 88
89static int p2_c_notify = GNUNET_NO; 89static int p2_c_notify = GNUNET_NO;
90 90
91
91static void 92static void
92end () 93end ()
93{ 94{
94 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Stopping peers\n"); 95 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
95 96 "Stopping peers\n");
96 97
97 if (send_task != GNUNET_SCHEDULER_NO_TASK) 98 if (send_task != GNUNET_SCHEDULER_NO_TASK)
98 GNUNET_SCHEDULER_cancel (send_task); 99 GNUNET_SCHEDULER_cancel (send_task);
@@ -130,8 +131,10 @@ end ()
130 ok = 0; 131 ok = 0;
131} 132}
132 133
134
133static void 135static void
134end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 136end_badly (void *cls,
137 const struct GNUNET_SCHEDULER_TaskContext *tc)
135{ 138{
136 die_task = GNUNET_SCHEDULER_NO_TASK; 139 die_task = GNUNET_SCHEDULER_NO_TASK;
137 140
@@ -339,12 +342,15 @@ notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
339 342
340 343
341static void 344static void
342testing_connect_cb (struct PeerContext *p1, struct PeerContext *p2, void *cls) 345testing_connect_cb (struct PeerContext *p1,
346 struct PeerContext *p2,
347 void *cls)
343{ 348{
344 cc = NULL; 349 cc = NULL;
345 char *p1_c = GNUNET_strdup (GNUNET_i2s (&p1->id)); 350 char *p1_c = GNUNET_strdup (GNUNET_i2s (&p1->id));
346 351
347 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Peers connected: %u (%s) <-> %u (%s)\n", 352 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
353 "Peers connected: %u (%s) <-> %u (%s)\n",
348 p1->no, p1_c, p2->no, GNUNET_i2s (&p2->id)); 354 p1->no, p1_c, p2->no, GNUNET_i2s (&p2->id));
349 GNUNET_free (p1_c); 355 GNUNET_free (p1_c);
350 356
@@ -360,7 +366,8 @@ start_cb (struct PeerContext *p, void *cls)
360 366
361 started++; 367 started++;
362 368
363 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Peer %u (`%s') started\n", p->no, 369 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
370 "Peer %u (`%s') started\n", p->no,
364 GNUNET_i2s (&p->id)); 371 GNUNET_i2s (&p->id));
365 372
366 if (started != 2) 373 if (started != 2)
@@ -380,17 +387,21 @@ start_cb (struct PeerContext *p, void *cls)
380} 387}
381 388
382 389
383static void monitor1_cb (void *cls, 390static void
384 const struct GNUNET_PeerIdentity *peer, 391monitor1_cb (void *cls,
385 const struct GNUNET_HELLO_Address *address, 392 const struct GNUNET_PeerIdentity *peer,
386 enum GNUNET_TRANSPORT_PeerState state, 393 const struct GNUNET_HELLO_Address *address,
387 struct GNUNET_TIME_Absolute state_timeout) 394 enum GNUNET_TRANSPORT_PeerState state,
395 struct GNUNET_TIME_Absolute state_timeout)
388{ 396{
389 if ((NULL == peer) || (NULL == p1)) 397 if ((NULL == peer) || (NULL == p1))
390 return; 398 return;
391 399
392 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Monitor 1: %s %s %s\n", 400 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
393 GNUNET_i2s (peer), GNUNET_TRANSPORT_ps2s(state), GNUNET_STRINGS_absolute_time_to_string(state_timeout)); 401 "Monitor 1: %s %s %s\n",
402 GNUNET_i2s (peer),
403 GNUNET_TRANSPORT_ps2s (state),
404 GNUNET_STRINGS_absolute_time_to_string(state_timeout));
394 if ((0 == memcmp (peer, &p2->id, sizeof (p2->id)) && 405 if ((0 == memcmp (peer, &p2->id, sizeof (p2->id)) &&
395 (GNUNET_YES == GNUNET_TRANSPORT_is_connected(state)) && 406 (GNUNET_YES == GNUNET_TRANSPORT_is_connected(state)) &&
396 GNUNET_NO == p1_c) ) 407 GNUNET_NO == p1_c) )
@@ -402,17 +413,21 @@ static void monitor1_cb (void *cls,
402} 413}
403 414
404 415
405static void monitor2_cb (void *cls, 416static void
406 const struct GNUNET_PeerIdentity *peer, 417monitor2_cb (void *cls,
407 const struct GNUNET_HELLO_Address *address, 418 const struct GNUNET_PeerIdentity *peer,
408 enum GNUNET_TRANSPORT_PeerState state, 419 const struct GNUNET_HELLO_Address *address,
409 struct GNUNET_TIME_Absolute state_timeout) 420 enum GNUNET_TRANSPORT_PeerState state,
421 struct GNUNET_TIME_Absolute state_timeout)
410{ 422{
411 if ((NULL == peer) || (NULL == p2)) 423 if ((NULL == peer) || (NULL == p2))
412 return; 424 return;
413 425
414 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Monitor 2: %s %s %s\n", 426 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
415 GNUNET_i2s (peer), GNUNET_TRANSPORT_ps2s (state), GNUNET_STRINGS_absolute_time_to_string(state_timeout)); 427 "Monitor 2: %s %s %s\n",
428 GNUNET_i2s (peer),
429 GNUNET_TRANSPORT_ps2s (state),
430 GNUNET_STRINGS_absolute_time_to_string(state_timeout));
416 if ((0 == memcmp (peer, &p1->id, sizeof (p1->id)) && 431 if ((0 == memcmp (peer, &p1->id, sizeof (p1->id)) &&
417 (GNUNET_YES == GNUNET_TRANSPORT_is_connected(state)) && 432 (GNUNET_YES == GNUNET_TRANSPORT_is_connected(state)) &&
418 GNUNET_NO == p2_c) ) 433 GNUNET_NO == p2_c) )
@@ -479,6 +494,7 @@ check ()
479 return ok; 494 return ok;
480} 495}
481 496
497
482int 498int
483main (int argc, char *argv[]) 499main (int argc, char *argv[])
484{ 500{