aboutsummaryrefslogtreecommitdiff
path: root/src/transport/test_transport_api_unreliability.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2012-11-05 15:50:23 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2012-11-05 15:50:23 +0000
commit60920228fd7344ededc9f0711f2b47ddffa02313 (patch)
tree74280880a891a0d29774c8eaa41ccafc0b957e24 /src/transport/test_transport_api_unreliability.c
parent4143a2a87350c92b920f286fd6ceabf3b3363c8e (diff)
downloadgnunet-60920228fd7344ededc9f0711f2b47ddffa02313.tar.gz
gnunet-60920228fd7344ededc9f0711f2b47ddffa02313.zip
doxygen error
Diffstat (limited to 'src/transport/test_transport_api_unreliability.c')
-rw-r--r--src/transport/test_transport_api_unreliability.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/transport/test_transport_api_unreliability.c b/src/transport/test_transport_api_unreliability.c
index e3ca4be1c..f1e249cdb 100644
--- a/src/transport/test_transport_api_unreliability.c
+++ b/src/transport/test_transport_api_unreliability.c
@@ -71,6 +71,8 @@ struct GNUNET_TRANSPORT_TESTING_handle *tth;
71 */ 71 */
72 72
73/** 73/**
74 * Total number of messages to send
75 *
74 * Note that this value must not significantly exceed 76 * Note that this value must not significantly exceed
75 * 'MAX_PENDING' in 'gnunet-service-transport.c', otherwise 77 * 'MAX_PENDING' in 'gnunet-service-transport.c', otherwise
76 * messages may be dropped even for a reliable transport. 78 * messages may be dropped even for a reliable transport.
@@ -161,7 +163,7 @@ end ()
161 { 163 {
162 if (get_bit (bitmap, i) == 0) 164 if (get_bit (bitmap, i) == 0)
163 { 165 {
164 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Did not receive message %d\n", i); 166 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Did not receive message %d\n", i);
165 ok = -1; 167 ok = -1;
166 } 168 }
167 } 169 }
@@ -260,7 +262,7 @@ set_bit (unsigned int bitIdx)
260static int 262static int
261get_bit (const char *map, unsigned int bit) 263get_bit (const char *map, unsigned int bit)
262{ 264{
263 if (bit >= TOTAL_MSGS) 265 if (bit > TOTAL_MSGS)
264 { 266 {
265 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "get bit %d of %d(!?!?)\n", bit, 267 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "get bit %d of %d(!?!?)\n", bit,
266 sizeof (bitmap) * 8); 268 sizeof (bitmap) * 8);
@@ -369,10 +371,11 @@ notify_ready (void *cls, size_t size, void *buf)
369 s = get_size (n); 371 s = get_size (n);
370 GNUNET_assert (size >= s); 372 GNUNET_assert (size >= s);
371 GNUNET_assert (buf != NULL); 373 GNUNET_assert (buf != NULL);
372 GNUNET_assert (n <= TOTAL_MSGS); 374 GNUNET_assert (n < TOTAL_MSGS);
373 cbuf = buf; 375 cbuf = buf;
374 do 376 do
375 { 377 {
378 GNUNET_assert (n < TOTAL_MSGS);
376 hdr.header.size = htons (s); 379 hdr.header.size = htons (s);
377 hdr.header.type = htons (MTYPE); 380 hdr.header.type = htons (MTYPE);
378 hdr.num = htonl (n); 381 hdr.num = htonl (n);
@@ -394,7 +397,7 @@ notify_ready (void *cls, size_t size, void *buf)
394 if (0 == GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 16)) 397 if (0 == GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 16))
395 break; /* sometimes pack buffer full, sometimes not */ 398 break; /* sometimes pack buffer full, sometimes not */
396 } 399 }
397 while (size - ret >= s); 400 while ((size - ret >= s) && (n < TOTAL_MSGS));
398 if (n < TOTAL_MSGS) 401 if (n < TOTAL_MSGS)
399 { 402 {
400 th = GNUNET_TRANSPORT_notify_transmit_ready (p2->th, &p1->id, s, 0, 403 th = GNUNET_TRANSPORT_notify_transmit_ready (p2->th, &p1->id, s, 0,
@@ -444,6 +447,8 @@ static void
444sendtask () 447sendtask ()
445{ 448{
446 start_time = GNUNET_TIME_absolute_get (); 449 start_time = GNUNET_TIME_absolute_get ();
450 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Starting to send %u messages\n",
451 TOTAL_MSGS);
447 th = GNUNET_TRANSPORT_notify_transmit_ready (p2->th, &p1->id, get_size (0), 0, 452 th = GNUNET_TRANSPORT_notify_transmit_ready (p2->th, &p1->id, get_size (0), 0,
448 TIMEOUT_TRANSMIT, &notify_ready, 453 TIMEOUT_TRANSMIT, &notify_ready,
449 NULL); 454 NULL);