summaryrefslogtreecommitdiff
path: root/src/testbed/gnunet-service-testbed_barriers.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testbed/gnunet-service-testbed_barriers.c')
-rw-r--r--src/testbed/gnunet-service-testbed_barriers.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/testbed/gnunet-service-testbed_barriers.c b/src/testbed/gnunet-service-testbed_barriers.c
index 831bc3c6d..638263103 100644
--- a/src/testbed/gnunet-service-testbed_barriers.c
+++ b/src/testbed/gnunet-service-testbed_barriers.c
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2008--2013 GNUnet e.V. 3 Copyright (C) 2008--2016 GNUnet e.V.
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published 6 it under the terms of the GNU General Public License as published
@@ -234,7 +234,7 @@ remove_barrier (struct Barrier *barrier)
234 GNUNET_CONTAINER_DLL_remove (barrier->head, 234 GNUNET_CONTAINER_DLL_remove (barrier->head,
235 barrier->tail, 235 barrier->tail,
236 ctx); 236 ctx);
237 GNUNET_free (ctx); 237 ctx->barrier = NULL;
238 } 238 }
239 GNUNET_free (barrier->name); 239 GNUNET_free (barrier->name);
240 GNUNET_free (barrier); 240 GNUNET_free (barrier);
@@ -546,6 +546,8 @@ wbarrier_status_cb (void *cls,
546 struct WBarrier *wrapper = cls; 546 struct WBarrier *wrapper = cls;
547 struct Barrier *barrier = wrapper->barrier; 547 struct Barrier *barrier = wrapper->barrier;
548 548
549 //FIXME: why are we removing the wrapper? They should only be removed if they
550 //barrier is crossed or errored out
549 GNUNET_assert (b_ == wrapper->hbarrier); 551 GNUNET_assert (b_ == wrapper->hbarrier);
550 wrapper->hbarrier = NULL; 552 wrapper->hbarrier = NULL;
551 GNUNET_CONTAINER_DLL_remove (barrier->whead, 553 GNUNET_CONTAINER_DLL_remove (barrier->whead,
@@ -713,6 +715,7 @@ handle_barrier_init (void *cls,
713 GNUNET_CONTAINER_DLL_insert_tail (barrier->whead, 715 GNUNET_CONTAINER_DLL_insert_tail (barrier->whead,
714 barrier->wtail, 716 barrier->wtail,
715 wrapper); 717 wrapper);
718 //FIXME: Increment barrier->num_wbarriers
716 wrapper->hbarrier = GNUNET_TESTBED_barrier_init_ (slave->controller, 719 wrapper->hbarrier = GNUNET_TESTBED_barrier_init_ (slave->controller,
717 barrier->name, 720 barrier->name,
718 barrier->quorum, 721 barrier->quorum,
@@ -898,16 +901,13 @@ handle_barrier_status (void *cls,
898 return; 901 return;
899 } 902 }
900 GNUNET_SERVICE_client_continue (client); 903 GNUNET_SERVICE_client_continue (client);
901 while (NULL != (client_ctx = barrier->head)) /* Notify peers */ 904 for(client_ctx = barrier->head; NULL != client_ctx; client_ctx = client_ctx->next) /* Notify peers */
902 { 905 {
903 env = GNUNET_MQ_msg_copy (&msg->header); 906 env = GNUNET_MQ_msg_copy (&msg->header);
904 GNUNET_MQ_send (GNUNET_SERVICE_client_get_mq (client), 907 GNUNET_MQ_send (GNUNET_SERVICE_client_get_mq (client_ctx->client),
905 env); 908 env);
906 GNUNET_CONTAINER_DLL_remove (barrier->head,
907 barrier->tail,
908 client_ctx);
909 client_ctx->barrier = NULL;
910 } 909 }
910 //FIXME: Send status to wrappers if they exist
911} 911}
912 912
913/* end of gnunet-service-testbed_barriers.c */ 913/* end of gnunet-service-testbed_barriers.c */