aboutsummaryrefslogtreecommitdiff
path: root/src/transport/test_quota_compliance.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-08-01 20:57:40 +0000
committerChristian Grothoff <christian@grothoff.org>2011-08-01 20:57:40 +0000
commit84f1d73fbe2480d9544cfd80fd165882340cb9d3 (patch)
tree4e895a6eaebf188a96c5ca4705f95be090b50914 /src/transport/test_quota_compliance.c
parentde5f7ca7ed2e9aaca009c8015848b956bb23c11d (diff)
downloadgnunet-84f1d73fbe2480d9544cfd80fd165882340cb9d3.tar.gz
gnunet-84f1d73fbe2480d9544cfd80fd165882340cb9d3.zip
a bit cleanr
Diffstat (limited to 'src/transport/test_quota_compliance.c')
-rw-r--r--src/transport/test_quota_compliance.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/transport/test_quota_compliance.c b/src/transport/test_quota_compliance.c
index 8d1cc0cee..2857a3057 100644
--- a/src/transport/test_quota_compliance.c
+++ b/src/transport/test_quota_compliance.c
@@ -303,10 +303,11 @@ notify_ready (void *cls, size_t size, void *buf)
303 ret += sizeof (struct TestMessage); 303 ret += sizeof (struct TestMessage);
304 memset (&cbuf[ret], last_msg_sent, s - sizeof (struct TestMessage)); 304 memset (&cbuf[ret], last_msg_sent, s - sizeof (struct TestMessage));
305 ret += s - sizeof (struct TestMessage); 305 ret += s - sizeof (struct TestMessage);
306 306#if DEBUG_MEASUREMENT
307 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 307 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
308 "Sending message %u\n",last_msg_sent); 308 "Sending message %u\n",
309 309 last_msg_sent);
310#endif
310 s = get_size (); 311 s = get_size ();
311 if (0 == GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 16)) 312 if (0 == GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 16))
312 break; /* sometimes pack buffer full, sometimes not */ 313 break; /* sometimes pack buffer full, sometimes not */
@@ -554,10 +555,12 @@ exchange_hello_last (void *cls,
554 struct PeerContext *me = cls; 555 struct PeerContext *me = cls;
555 556
556 GNUNET_assert (message != NULL); 557 GNUNET_assert (message != NULL);
558#if DEBUG_CONNECTIONS
557 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 559 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
558 "Exchanging HELLO of size %d with peer (%s)!\n", 560 "Exchanging HELLO of size %d with peer (%s)!\n",
559 (int) GNUNET_HELLO_size((const struct GNUNET_HELLO_Message *)message), 561 (int) GNUNET_HELLO_size((const struct GNUNET_HELLO_Message *)message),
560 GNUNET_i2s (&me->id)); 562 GNUNET_i2s (&me->id));
563#endif
561 GNUNET_assert (GNUNET_OK == 564 GNUNET_assert (GNUNET_OK ==
562 GNUNET_HELLO_get_id ((const struct GNUNET_HELLO_Message *) 565 GNUNET_HELLO_get_id ((const struct GNUNET_HELLO_Message *)
563 message, &me->id)); 566 message, &me->id));
@@ -576,10 +579,12 @@ exchange_hello (void *cls,
576 GNUNET_assert (GNUNET_OK == 579 GNUNET_assert (GNUNET_OK ==
577 GNUNET_HELLO_get_id ((const struct GNUNET_HELLO_Message *) 580 GNUNET_HELLO_get_id ((const struct GNUNET_HELLO_Message *)
578 message, &me->id)); 581 message, &me->id));
582#if DEBUG_CONNECTIONS
579 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 583 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
580 "Exchanging HELLO of size %d from peer %s!\n", 584 "Exchanging HELLO of size %d from peer %s!\n",
581 (int) GNUNET_HELLO_size((const struct GNUNET_HELLO_Message *)message), 585 (int) GNUNET_HELLO_size((const struct GNUNET_HELLO_Message *)message),
582 GNUNET_i2s (&me->id)); 586 GNUNET_i2s (&me->id));
587#endif
583 GNUNET_TRANSPORT_offer_hello (p2.th, message, NULL, NULL); 588 GNUNET_TRANSPORT_offer_hello (p2.th, message, NULL, NULL);
584} 589}
585 590
@@ -670,8 +675,10 @@ static void
670try_connect (void *cls, 675try_connect (void *cls,
671 const struct GNUNET_SCHEDULER_TaskContext *tc) 676 const struct GNUNET_SCHEDULER_TaskContext *tc)
672{ 677{
678#if DEBUG_CONNECTIONS
673 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 679 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
674 "Asking peers to connect...\n"); 680 "Asking peers to connect...\n");
681#endif
675 GNUNET_TRANSPORT_try_connect (p2.th, 682 GNUNET_TRANSPORT_try_connect (p2.th,
676 &p1.id); 683 &p1.id);
677 GNUNET_TRANSPORT_try_connect (p1.th, 684 GNUNET_TRANSPORT_try_connect (p1.th,