topology option support for GNUNET_TESTBED_run() via configuration
[oweals/gnunet.git] / src / testbed / testbed_api_topology.c
index 2eb2d6dbd7a3030221f6049866d804f5f49a7ff4..edf0f5d3f40ead2b8963ba3ec467631c4268e370 100644 (file)
@@ -177,7 +177,7 @@ oprelease_overlay_configure_topology (void *cls)
   {
     for (p = 0; p < tc->link_array_size; p++)
       if (NULL != tc->link_array[p].op)
-        GNUNET_TESTBED_operation_cancel (tc->link_array[p].op);
+        GNUNET_TESTBED_operation_done (tc->link_array[p].op);
     GNUNET_free (tc->link_array);
   }
   GNUNET_free (tc);
@@ -339,6 +339,8 @@ GNUNET_TESTBED_overlay_configure_topology_va (void *op_cls,
     default:
       GNUNET_break (0);         /* Should not use any other option apart from
                                    the ones handled here */
+      GNUNET_free_non_null (tc->link_array);
+      GNUNET_free (tc);
       return NULL;
     }
   } while (GNUNET_TESTBED_TOPOLOGY_OPTION_END != secondary_option);
@@ -347,6 +349,7 @@ GNUNET_TESTBED_overlay_configure_topology_va (void *op_cls,
                                         &oprelease_overlay_configure_topology);
   GNUNET_TESTBED_operation_queue_insert_
       (c->opq_parallel_topology_config_operations, op);
+  GNUNET_TESTBED_operation_begin_wait_ (op);
   return op;
 }