aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/testing/testing_group.c27
1 files changed, 3 insertions, 24 deletions
diff --git a/src/testing/testing_group.c b/src/testing/testing_group.c
index 905fbcf80..24a98e612 100644
--- a/src/testing/testing_group.c
+++ b/src/testing/testing_group.c
@@ -843,13 +843,6 @@ uid_from_hash (const GNUNET_HashCode * hash, uint32_t * uid)
843static int outstanding_connects; 843static int outstanding_connects;
844 844
845/** 845/**
846 * Number of connects we have scheduled at the same
847 * time, the more we already have scheduled the longer
848 * we should wait before calling schedule_connect again.
849 */
850static int outstanding_scheduled_connects;
851
852/**
853 * Get a topology from a string input. 846 * Get a topology from a string input.
854 * 847 *
855 * @param topology where to write the retrieved topology 848 * @param topology where to write the retrieved topology
@@ -2851,14 +2844,8 @@ schedule_connect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
2851 _ 2844 _
2852 ("Delaying connect, we have too many outstanding connections!\n")); 2845 ("Delaying connect, we have too many outstanding connections!\n"));
2853#endif 2846#endif
2854 if (GNUNET_NO == connect_context->counted) 2847 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
2855 { 2848 (GNUNET_TIME_UNIT_MILLISECONDS, 100),
2856 connect_context->counted = GNUNET_YES;
2857 outstanding_scheduled_connects++;
2858 }
2859 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_add (GNUNET_TIME_relative_multiply
2860 (GNUNET_TIME_UNIT_MILLISECONDS, 100), GNUNET_TIME_relative_multiply
2861 (GNUNET_TIME_UNIT_MILLISECONDS, outstanding_scheduled_connects * 2)),
2862 &schedule_connect, connect_context); 2849 &schedule_connect, connect_context);
2863 } 2850 }
2864 else 2851 else
@@ -2869,7 +2856,6 @@ schedule_connect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
2869 outstanding_connects); 2856 outstanding_connects);
2870#endif 2857#endif
2871 outstanding_connects++; 2858 outstanding_connects++;
2872 outstanding_scheduled_connects--;
2873 GNUNET_TESTING_daemons_connect (connect_context->first, 2859 GNUNET_TESTING_daemons_connect (connect_context->first,
2874 connect_context->second, 2860 connect_context->second,
2875 CONNECT_TIMEOUT, 2861 CONNECT_TIMEOUT,
@@ -3044,14 +3030,7 @@ connect_topology (struct GNUNET_TESTING_PeerGroup *pg,
3044 connect_context->first = pg->peers[pg_iter].daemon; 3030 connect_context->first = pg->peers[pg_iter].daemon;
3045 connect_context->second = pg->peers[connection_iter->index].daemon; 3031 connect_context->second = pg->peers[connection_iter->index].daemon;
3046 connect_context->ct_ctx = ct_ctx; 3032 connect_context->ct_ctx = ct_ctx;
3047 if (total < MAX_OUTSTANDING_CONNECTIONS) 3033 GNUNET_SCHEDULER_add_now (&schedule_connect, connect_context);
3048 {
3049 GNUNET_SCHEDULER_add_now (&schedule_connect, connect_context);
3050 }
3051 else
3052 {
3053 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MILLISECONDS, 1000 * (total / MAX_OUTSTANDING_CONNECTIONS)), &schedule_connect, connect_context);
3054 }
3055 connection_iter = connection_iter->next; 3034 connection_iter = connection_iter->next;
3056 total++; 3035 total++;
3057 } 3036 }