diff options
Diffstat (limited to 'src/testing')
-rw-r--r-- | src/testing/testing_group.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/testing/testing_group.c b/src/testing/testing_group.c index c76f3b54d..ac4a60dad 100644 --- a/src/testing/testing_group.c +++ b/src/testing/testing_group.c | |||
@@ -365,6 +365,11 @@ struct GNUNET_TESTING_PeerGroup | |||
365 | * How many peers are being started right now? | 365 | * How many peers are being started right now? |
366 | */ | 366 | */ |
367 | unsigned int starting; | 367 | unsigned int starting; |
368 | |||
369 | /** | ||
370 | * How many peers have already been started? | ||
371 | */ | ||
372 | unsigned int started; | ||
368 | }; | 373 | }; |
369 | 374 | ||
370 | struct UpdateContext | 375 | struct UpdateContext |
@@ -2850,7 +2855,14 @@ static void internal_hostkey_callback (void *cls, | |||
2850 | { | 2855 | { |
2851 | struct InternalStartContext *internal_context = cls; | 2856 | struct InternalStartContext *internal_context = cls; |
2852 | internal_context->peer->pg->starting--; | 2857 | internal_context->peer->pg->starting--; |
2853 | internal_context->hostkey_callback(internal_context->hostkey_cls, id, d, emsg); | 2858 | internal_context->peer->pg->started++; |
2859 | if (internal_context->hostkey_callback != NULL) | ||
2860 | internal_context->hostkey_callback(internal_context->hostkey_cls, id, d, emsg); | ||
2861 | else if (internal_context->peer->pg->started == internal_context->peer->pg->total) | ||
2862 | { | ||
2863 | internal_context->peer->pg->started = 0; /* Internal startup may use this counter! */ | ||
2864 | GNUNET_TESTING_daemons_continue_startup(internal_context->peer->pg); | ||
2865 | } | ||
2854 | } | 2866 | } |
2855 | 2867 | ||
2856 | /** | 2868 | /** |
@@ -2871,7 +2883,8 @@ static void internal_startup_callback (void *cls, | |||
2871 | { | 2883 | { |
2872 | struct InternalStartContext *internal_context = cls; | 2884 | struct InternalStartContext *internal_context = cls; |
2873 | internal_context->peer->pg->starting--; | 2885 | internal_context->peer->pg->starting--; |
2874 | internal_context->start_cb(internal_context->start_cb_cls, id, cfg, d, emsg); | 2886 | if (internal_context->start_cb != NULL) |
2887 | internal_context->start_cb(internal_context->start_cb_cls, id, cfg, d, emsg); | ||
2875 | } | 2888 | } |
2876 | 2889 | ||
2877 | static void | 2890 | static void |