guix-env: some update.
[oweals/gnunet.git] / src / testbed / testbed_api.c
index 53f70a1c09b2e8072bbb2beaed148ab7b2bd3194..0e0a5da9c9d4881ae3933f1e2daddfc9e2ed0fde 100644 (file)
@@ -75,7 +75,7 @@ struct ForwardedOperationData
   /**
    * The callback to call when reply is available
    */
-  GNUNET_CLIENT_MessageHandler cc;
+  GNUNET_MQ_MessageCallback cc;
 
   /**
    * The closure for the above callback
@@ -1298,14 +1298,25 @@ handle_barrier_status (void *cls,
   GNUNET_assert (NULL != barrier->cb);
   if ((GNUNET_YES == barrier->echo) &&
       (GNUNET_TESTBED_BARRIERSTATUS_CROSSED == status))
-    GNUNET_TESTBED_queue_message_ (c, GNUNET_copy_message (&msg->header));
-  barrier->cb (barrier->cls, name, barrier, status, emsg);
+    GNUNET_TESTBED_queue_message_ (c,
+                                   GNUNET_copy_message (&msg->header));
+  barrier->cb (barrier->cls,
+               name,
+               barrier,
+               status,
+               emsg);
   if (GNUNET_TESTBED_BARRIERSTATUS_INITIALISED == status)
     return;           /* just initialised; skip cleanup */
 
  cleanup:
   GNUNET_free_non_null (emsg);
-  if (NULL != barrier)
+  /**
+   * Do not remove the barrier if we did not echo the status back; this is
+   * required at the chained testbed controller setup to ensure the only the
+   * test-driver echos the status and the controller hierarchy properly
+   * propagates the status.
+   */
+  if ((NULL != barrier) && (GNUNET_YES == barrier->echo))
     GNUNET_TESTBED_barrier_remove_ (barrier);
 }
 
@@ -1357,7 +1368,7 @@ struct OperationContext *
 GNUNET_TESTBED_forward_operation_msg_ (struct GNUNET_TESTBED_Controller *controller,
                                        uint64_t operation_id,
                                        const struct GNUNET_MessageHeader *msg,
-                                       GNUNET_CLIENT_MessageHandler cc,
+                                       GNUNET_MQ_MessageCallback cc,
                                        void *cc_cls)
 {
   struct OperationContext *opc;
@@ -1590,7 +1601,7 @@ GNUNET_TESTBED_controller_connect (struct GNUNET_TESTBED_Host *host,
                            controller),
     GNUNET_MQ_hd_var_size (barrier_status,
                            GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_STATUS,
-                           const struct GNUNET_TESTBED_BarrierStatusMsg,
+                           struct GNUNET_TESTBED_BarrierStatusMsg,
                            controller),
     GNUNET_MQ_handler_end ()
   };
@@ -1635,7 +1646,7 @@ GNUNET_TESTBED_controller_connect (struct GNUNET_TESTBED_Host *host,
   controller->cc_cls = cc_cls;
   controller->event_mask = event_mask;
   controller->cfg = GNUNET_CONFIGURATION_dup (cfg);
-  controller->mq = GNUNET_CLIENT_connecT (controller->cfg,
+  controller->mq = GNUNET_CLIENT_connect (controller->cfg,
                                           "testbed",
                                           handlers,
                                           &mq_error_handler,