diff options
author | Nathan S. Evans <evans@in.tum.de> | 2010-06-27 13:45:39 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2010-06-27 13:45:39 +0000 |
commit | 065fda1fb517676c7c6850e06f21a38e8e94f045 (patch) | |
tree | 407a5bd008c6024e30baf98745ce1c6228ac1e28 | |
parent | 269edcfc22cea65fda93c958ddc97033a292acf9 (diff) | |
download | gnunet-065fda1fb517676c7c6850e06f21a38e8e94f045.tar.gz gnunet-065fda1fb517676c7c6850e06f21a38e8e94f045.zip |
put number of additional messages in config file
-rw-r--r-- | src/dv/test_transport_api_dv.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/dv/test_transport_api_dv.c b/src/dv/test_transport_api_dv.c index 706407f15..1983908e8 100644 --- a/src/dv/test_transport_api_dv.c +++ b/src/dv/test_transport_api_dv.c | |||
@@ -41,12 +41,16 @@ | |||
41 | 41 | ||
42 | #define DEFAULT_NUM_PEERS 4 | 42 | #define DEFAULT_NUM_PEERS 4 |
43 | 43 | ||
44 | #define DEFAULT_ADDITIONAL_MESSAGES 2 | ||
45 | |||
44 | #define MAX_OUTSTANDING_CONNECTIONS 100 | 46 | #define MAX_OUTSTANDING_CONNECTIONS 100 |
45 | 47 | ||
46 | static float fail_percentage = 0.00; | 48 | static float fail_percentage = 0.00; |
47 | 49 | ||
48 | static int ok; | 50 | static int ok; |
49 | 51 | ||
52 | static unsigned long long num_additional_messages; | ||
53 | |||
50 | static unsigned long long num_peers; | 54 | static unsigned long long num_peers; |
51 | 55 | ||
52 | static unsigned int total_connections; | 56 | static unsigned int total_connections; |
@@ -699,7 +703,6 @@ topology_callback (void *cls, | |||
699 | GNUNET_SCHEDULER_cancel (sched, die_task); | 703 | GNUNET_SCHEDULER_cancel (sched, die_task); |
700 | die_task = GNUNET_SCHEDULER_NO_TASK; | 704 | die_task = GNUNET_SCHEDULER_NO_TASK; |
701 | GNUNET_SCHEDULER_add_now (sched, &send_test_messages, test_messages); | 705 | GNUNET_SCHEDULER_add_now (sched, &send_test_messages, test_messages); |
702 | //GNUNET_SCHEDULER_add_delayed (sched, GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 1), &send_test_messages, test_messages); | ||
703 | } | 706 | } |
704 | else if (total_connections + failed_connections == expected_connections) | 707 | else if (total_connections + failed_connections == expected_connections) |
705 | { | 708 | { |
@@ -708,7 +711,6 @@ topology_callback (void *cls, | |||
708 | GNUNET_SCHEDULER_cancel (sched, die_task); | 711 | GNUNET_SCHEDULER_cancel (sched, die_task); |
709 | die_task = GNUNET_SCHEDULER_NO_TASK; | 712 | die_task = GNUNET_SCHEDULER_NO_TASK; |
710 | GNUNET_SCHEDULER_add_now (sched, &send_test_messages, test_messages); | 713 | GNUNET_SCHEDULER_add_now (sched, &send_test_messages, test_messages); |
711 | //GNUNET_SCHEDULER_add_delayed (sched, GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 1), &send_test_messages, test_messages); | ||
712 | } | 714 | } |
713 | else | 715 | else |
714 | { | 716 | { |
@@ -840,9 +842,8 @@ static void all_connect_handler (void *cls, | |||
840 | } | 842 | } |
841 | GNUNET_free(second_shortname); | 843 | GNUNET_free(second_shortname); |
842 | 844 | ||
843 | if ((num_peers == 3) && (temp_total_other_messages == 2)) | 845 | if (temp_total_other_messages == num_additional_messages) |
844 | { | 846 | { |
845 | /*GNUNET_SCHEDULER_add_delayed (sched, GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30), &send_other_messages, NULL);*/ | ||
846 | GNUNET_SCHEDULER_add_now (sched, &send_other_messages, NULL); | 847 | GNUNET_SCHEDULER_add_now (sched, &send_other_messages, NULL); |
847 | } | 848 | } |
848 | } | 849 | } |
@@ -1027,6 +1028,11 @@ run (void *cls, | |||
1027 | &num_peers)) | 1028 | &num_peers)) |
1028 | num_peers = DEFAULT_NUM_PEERS; | 1029 | num_peers = DEFAULT_NUM_PEERS; |
1029 | 1030 | ||
1031 | if (GNUNET_SYSERR == | ||
1032 | GNUNET_CONFIGURATION_get_value_number (cfg, "testing", "additional_messages", | ||
1033 | &num_additional_messages)) | ||
1034 | num_additional_messages = DEFAULT_ADDITIONAL_MESSAGES; | ||
1035 | |||
1030 | main_cfg = cfg; | 1036 | main_cfg = cfg; |
1031 | 1037 | ||
1032 | peers_left = num_peers; | 1038 | peers_left = num_peers; |