diff options
Diffstat (limited to 'src/transport/test_communicator_basic.c')
-rw-r--r-- | src/transport/test_communicator_basic.c | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/src/transport/test_communicator_basic.c b/src/transport/test_communicator_basic.c index 975a0a837..bba8025af 100644 --- a/src/transport/test_communicator_basic.c +++ b/src/transport/test_communicator_basic.c | |||
@@ -91,7 +91,7 @@ static struct GNUNET_STATISTICS_GetHandle *rekey_stats[NUM_PEERS]; | |||
91 | 91 | ||
92 | #define ALLOWED_PACKET_LOSS 91 | 92 | #define ALLOWED_PACKET_LOSS 91 |
93 | 93 | ||
94 | #define BURST_PACKETS 15000 | 94 | #define BURST_PACKETS 5000 |
95 | 95 | ||
96 | #define TOTAL_ITERATIONS 1 | 96 | #define TOTAL_ITERATIONS 1 |
97 | 97 | ||
@@ -394,7 +394,8 @@ process_statistics (void *cls, | |||
394 | { | 394 | { |
395 | ret = 2; | 395 | ret = 2; |
396 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 396 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
397 | "Not enough BOX messages!\n"); | 397 | "Not enough BOX messages! (want: %u, have %llu)\n", |
398 | 9000, value); | ||
398 | GNUNET_SCHEDULER_shutdown (); | 399 | GNUNET_SCHEDULER_shutdown (); |
399 | } | 400 | } |
400 | if ((0 == strcmp ("rekey", test_name)) && | 401 | if ((0 == strcmp ("rekey", test_name)) && |
@@ -433,11 +434,13 @@ short_test_cb (void *cls) | |||
433 | tc_h); | 434 | tc_h); |
434 | payload = make_payload (SHORT_MESSAGE_SIZE); | 435 | payload = make_payload (SHORT_MESSAGE_SIZE); |
435 | num_sent_short[peer_nr]++; | 436 | num_sent_short[peer_nr]++; |
437 | if (burst_packets_short == num_sent_short[peer_nr]) | ||
438 | tc_h->cont = NULL; | ||
439 | else | ||
440 | tc_h->cont = short_test; | ||
441 | tc_h->cont_cls = cls; | ||
436 | GNUNET_TRANSPORT_TESTING_transport_communicator_send (tc_h, | 442 | GNUNET_TRANSPORT_TESTING_transport_communicator_send (tc_h, |
437 | (burst_packets_short == | 443 | NULL, |
438 | num_sent_short[peer_nr]) | ||
439 | ? NULL | ||
440 | : &short_test, | ||
441 | cls, | 444 | cls, |
442 | payload, | 445 | payload, |
443 | SHORT_MESSAGE_SIZE); | 446 | SHORT_MESSAGE_SIZE); |
@@ -478,11 +481,13 @@ size_test (void *cls) | |||
478 | ack[peer_nr] += 10; | 481 | ack[peer_nr] += 10; |
479 | payload = make_payload (ack[peer_nr]); | 482 | payload = make_payload (ack[peer_nr]); |
480 | num_sent_size[peer_nr]++; | 483 | num_sent_size[peer_nr]++; |
484 | if (ack[peer_nr] >= max_size) | ||
485 | tc_h->cont = NULL; | ||
486 | else | ||
487 | tc_h->cont = size_test; | ||
488 | tc_h->cont_cls = cls; | ||
481 | GNUNET_TRANSPORT_TESTING_transport_communicator_send (tc_h, | 489 | GNUNET_TRANSPORT_TESTING_transport_communicator_send (tc_h, |
482 | (ack[peer_nr] < | 490 | NULL, |
483 | max_size) | ||
484 | ? &size_test | ||
485 | : NULL, | ||
486 | cls, | 491 | cls, |
487 | payload, | 492 | payload, |
488 | ack[peer_nr]); | 493 | ack[peer_nr]); |
@@ -512,11 +517,13 @@ long_test_cb (void *cls) | |||
512 | (unsigned int) num_received_long[peer_nr]); | 517 | (unsigned int) num_received_long[peer_nr]); |
513 | payload = make_payload (long_message_size); | 518 | payload = make_payload (long_message_size); |
514 | num_sent_long[peer_nr]++; | 519 | num_sent_long[peer_nr]++; |
520 | if (burst_packets_long == num_sent_long[peer_nr]) | ||
521 | tc_h->cont = NULL; | ||
522 | else | ||
523 | tc_h->cont = long_test; | ||
524 | tc_h->cont_cls = cls; | ||
515 | GNUNET_TRANSPORT_TESTING_transport_communicator_send (tc_h, | 525 | GNUNET_TRANSPORT_TESTING_transport_communicator_send (tc_h, |
516 | (burst_packets_long == | 526 | NULL, |
517 | num_sent_long[peer_nr]) | ||
518 | ? NULL | ||
519 | : &long_test, | ||
520 | cls, | 527 | cls, |
521 | payload, | 528 | payload, |
522 | long_message_size); | 529 | long_message_size); |
@@ -936,7 +943,8 @@ incoming_message_cb ( | |||
936 | if (long_message_size != payload_len) | 943 | if (long_message_size != payload_len) |
937 | { | 944 | { |
938 | LOG (GNUNET_ERROR_TYPE_WARNING, | 945 | LOG (GNUNET_ERROR_TYPE_WARNING, |
939 | "Ignoring packet with wrong length\n"); | 946 | "Ignoring packet with wrong length (have: %lu, want: %lu)\n", |
947 | payload_len, long_message_size); | ||
940 | return; // Ignore | 948 | return; // Ignore |
941 | } | 949 | } |
942 | num_received_long[peer_nr]++; | 950 | num_received_long[peer_nr]++; |