diff options
author | Nathan S. Evans <evans@in.tum.de> | 2010-09-20 09:56:52 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2010-09-20 09:56:52 +0000 |
commit | 59f3b502b217de8f28b4071eac6928cadcad895b (patch) | |
tree | 6a4280b92c98b8bbf9b1f346738f29d6ed16d53f /src | |
parent | 303119730ef1e0fef9e5da1190ebce11557cce50 (diff) | |
download | gnunet-59f3b502b217de8f28b4071eac6928cadcad895b.tar.gz gnunet-59f3b502b217de8f28b4071eac6928cadcad895b.zip |
daemons_vary fix
Diffstat (limited to 'src')
-rw-r--r-- | src/testing/testing_group.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/testing/testing_group.c b/src/testing/testing_group.c index 6f100cbdd..84260924b 100644 --- a/src/testing/testing_group.c +++ b/src/testing/testing_group.c | |||
@@ -4135,19 +4135,23 @@ GNUNET_TESTING_daemons_vary (struct GNUNET_TESTING_PeerGroup *pg, | |||
4135 | GNUNET_TESTING_NotifyCompletion cb, | 4135 | GNUNET_TESTING_NotifyCompletion cb, |
4136 | void *cb_cls) | 4136 | void *cb_cls) |
4137 | { | 4137 | { |
4138 | struct ShutdownContext *shutdown_ctx; | ||
4139 | struct ChurnRestartContext *startup_ctx; | ||
4138 | struct ChurnContext *churn_ctx; | 4140 | struct ChurnContext *churn_ctx; |
4139 | 4141 | ||
4140 | if (GNUNET_NO == desired_status) | 4142 | if (GNUNET_NO == desired_status) |
4141 | { | 4143 | { |
4142 | if (NULL != pg->peers[offset].daemon) | 4144 | if (NULL != pg->peers[offset].daemon) |
4143 | { | 4145 | { |
4146 | shutdown_ctx = GNUNET_malloc(sizeof(struct ShutdownContext)); | ||
4144 | churn_ctx = GNUNET_malloc(sizeof(struct ChurnContext)); | 4147 | churn_ctx = GNUNET_malloc(sizeof(struct ChurnContext)); |
4145 | churn_ctx->num_to_start = 0; | 4148 | churn_ctx->num_to_start = 0; |
4146 | churn_ctx->num_to_stop = 1; | 4149 | churn_ctx->num_to_stop = 1; |
4147 | churn_ctx->cb = cb; | 4150 | churn_ctx->cb = cb; |
4148 | churn_ctx->cb_cls = cb_cls; | 4151 | churn_ctx->cb_cls = cb_cls; |
4152 | shutdown_ctx->cb_cls = churn_ctx; | ||
4149 | GNUNET_TESTING_daemon_stop(pg->peers[offset].daemon, | 4153 | GNUNET_TESTING_daemon_stop(pg->peers[offset].daemon, |
4150 | timeout, &churn_stop_callback, churn_ctx, | 4154 | timeout, &churn_stop_callback, shutdown_ctx, |
4151 | GNUNET_NO, GNUNET_YES); | 4155 | GNUNET_NO, GNUNET_YES); |
4152 | } | 4156 | } |
4153 | } | 4157 | } |
@@ -4155,13 +4159,15 @@ GNUNET_TESTING_daemons_vary (struct GNUNET_TESTING_PeerGroup *pg, | |||
4155 | { | 4159 | { |
4156 | if (NULL == pg->peers[offset].daemon) | 4160 | if (NULL == pg->peers[offset].daemon) |
4157 | { | 4161 | { |
4162 | startup_ctx = GNUNET_malloc(sizeof(struct ChurnRestartContext)); | ||
4158 | churn_ctx = GNUNET_malloc(sizeof(struct ChurnContext)); | 4163 | churn_ctx = GNUNET_malloc(sizeof(struct ChurnContext)); |
4159 | churn_ctx->num_to_start = 1; | 4164 | churn_ctx->num_to_start = 1; |
4160 | churn_ctx->num_to_stop = 0; | 4165 | churn_ctx->num_to_stop = 0; |
4161 | churn_ctx->cb = cb; | 4166 | churn_ctx->cb = cb; |
4162 | churn_ctx->cb_cls = cb_cls; | 4167 | churn_ctx->cb_cls = cb_cls; |
4168 | startup_ctx->churn_ctx = churn_ctx; | ||
4163 | GNUNET_TESTING_daemon_start_stopped(pg->peers[offset].daemon, | 4169 | GNUNET_TESTING_daemon_start_stopped(pg->peers[offset].daemon, |
4164 | timeout, &churn_start_callback, churn_ctx); | 4170 | timeout, &churn_start_callback, startup_ctx); |
4165 | } | 4171 | } |
4166 | } | 4172 | } |
4167 | else | 4173 | else |