- relaxed to accommodate overlay linking timeouts
[oweals/gnunet.git] / src / testbed / testbed_api.c
index 7f9aeff0feb92cc3404f261893f35b5fea742e87..ebb9496f2805a4d840f7d622e2f8f8b9ae063369 100644 (file)
@@ -1566,6 +1566,7 @@ GNUNET_TESTBED_controller_connect (const struct GNUNET_CONFIGURATION_Handle
   unsigned long long max_parallel_operations;
   unsigned long long max_parallel_service_connections;
   unsigned long long max_parallel_topology_config_operations;
+  unsigned long long max_parallel_overlay_connect_operations;
 
   if (GNUNET_OK !=
       GNUNET_CONFIGURATION_get_value_number (cfg, "testbed",
@@ -1591,6 +1592,14 @@ GNUNET_TESTBED_controller_connect (const struct GNUNET_CONFIGURATION_Handle
     GNUNET_break (0);
     return NULL;
   }
+  if (GNUNET_OK !=
+      GNUNET_CONFIGURATION_get_value_number (cfg, "testbed",
+                                             "MAX_PARALLEL_OVERLAY_CONNECT_OPERATIONS",
+                                             &max_parallel_overlay_connect_operations))
+  {
+    GNUNET_break (0);
+    return NULL;
+  }
   controller = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_Controller));
   controller->cc = cc;
   controller->cc_cls = cc_cls;
@@ -1628,7 +1637,10 @@ GNUNET_TESTBED_controller_connect (const struct GNUNET_CONFIGURATION_Handle
                                               max_parallel_service_connections);
   controller->opq_parallel_topology_config_operations=
       GNUNET_TESTBED_operation_queue_create_ ((unsigned int)
-                                              max_parallel_service_connections);
+                                              max_parallel_topology_config_operations);
+  controller->opq_parallel_overlay_connect_operations=
+      GNUNET_TESTBED_operation_queue_create_ ((unsigned int)
+                                              max_parallel_overlay_connect_operations);
   controller_hostname = GNUNET_TESTBED_host_get_hostname_ (host);
   if (NULL == controller_hostname)
     controller_hostname = "127.0.0.1";
@@ -1719,6 +1731,8 @@ GNUNET_TESTBED_controller_disconnect (struct GNUNET_TESTBED_Controller
       (controller->opq_parallel_service_connections);
   GNUNET_TESTBED_operation_queue_destroy_
       (controller->opq_parallel_topology_config_operations);
+  GNUNET_TESTBED_operation_queue_destroy_
+      (controller->opq_parallel_overlay_connect_operations);
   GNUNET_free (controller);
 }
 
@@ -2040,8 +2054,9 @@ GNUNET_TESTBED_controller_link (void *op_cls,
 
   GNUNET_assert (GNUNET_YES ==
                  GNUNET_TESTBED_is_host_registered_ (delegated_host, master));
-  slave_host_id = (NULL == slave_host) ?
-      0 : GNUNET_TESTBED_host_get_id_ (slave_host);
+  slave_host_id = 
+      GNUNET_TESTBED_host_get_id_ ((NULL != slave_host)
+                                   ? slave_host : master->host);
   delegated_host_id = GNUNET_TESTBED_host_get_id_ (delegated_host);
   if ((NULL != slave_host) && (0 != slave_host_id))
     GNUNET_assert (GNUNET_YES ==