aboutsummaryrefslogtreecommitdiff
path: root/src/testbed/testbed_api_hosts.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testbed/testbed_api_hosts.c')
-rw-r--r--src/testbed/testbed_api_hosts.c43
1 files changed, 36 insertions, 7 deletions
diff --git a/src/testbed/testbed_api_hosts.c b/src/testbed/testbed_api_hosts.c
index f61129b85..c386d18a0 100644
--- a/src/testbed/testbed_api_hosts.c
+++ b/src/testbed/testbed_api_hosts.c
@@ -1261,20 +1261,33 @@ GNUNET_TESTBED_controller_start (const char *trusted_ip,
1261 1261
1262 1262
1263/** 1263/**
1264 * Stop the controller process (also will terminate all peers and controllers 1264 * Sends termination signal to the controller's helper process
1265 * dependent on this controller). This function blocks until the testbed has
1266 * been fully terminated (!). The controller status cb from
1267 * GNUNET_TESTBED_controller_start() will not be called.
1268 * 1265 *
1269 * @param cproc the controller process handle 1266 * @param cproc the handle to the controller's helper process
1270 */ 1267 */
1271void 1268void
1272GNUNET_TESTBED_controller_stop (struct GNUNET_TESTBED_ControllerProc *cproc) 1269GNUNET_TESTBED_controller_kill_ (struct GNUNET_TESTBED_ControllerProc *cproc)
1273{ 1270{
1274 if (NULL != cproc->shandle) 1271 if (NULL != cproc->shandle)
1275 GNUNET_HELPER_send_cancel (cproc->shandle); 1272 GNUNET_HELPER_send_cancel (cproc->shandle);
1276 if (NULL != cproc->helper) 1273 if (NULL != cproc->helper)
1277 GNUNET_HELPER_soft_stop (cproc->helper); 1274 GNUNET_HELPER_kill (cproc->helper, GNUNET_YES);
1275}
1276
1277
1278/**
1279 * Cleans-up the controller's helper process handle
1280 *
1281 * @param cproc the handle to the controller's helper process
1282 */
1283void
1284GNUNET_TESTBED_controller_destroy_ (struct GNUNET_TESTBED_ControllerProc *cproc)
1285{
1286 if (NULL != cproc->helper)
1287 {
1288 GNUNET_break (GNUNET_OK == GNUNET_HELPER_wait (cproc->helper));
1289 GNUNET_HELPER_destroy (cproc->helper);
1290 }
1278 if (NULL != cproc->helper_argv) 1291 if (NULL != cproc->helper_argv)
1279 free_argv (cproc->helper_argv); 1292 free_argv (cproc->helper_argv);
1280 cproc->host->controller_started = GNUNET_NO; 1293 cproc->host->controller_started = GNUNET_NO;
@@ -1284,6 +1297,22 @@ GNUNET_TESTBED_controller_stop (struct GNUNET_TESTBED_ControllerProc *cproc)
1284 1297
1285 1298
1286/** 1299/**
1300 * Stop the controller process (also will terminate all peers and controllers
1301 * dependent on this controller). This function blocks until the testbed has
1302 * been fully terminated (!). The controller status cb from
1303 * GNUNET_TESTBED_controller_start() will not be called.
1304 *
1305 * @param cproc the controller process handle
1306 */
1307void
1308GNUNET_TESTBED_controller_stop (struct GNUNET_TESTBED_ControllerProc *cproc)
1309{
1310 GNUNET_TESTBED_controller_kill_ (cproc);
1311 GNUNET_TESTBED_controller_destroy_ (cproc);
1312}
1313
1314
1315/**
1287 * The handle for whether a host is habitable or not 1316 * The handle for whether a host is habitable or not
1288 */ 1317 */
1289struct GNUNET_TESTBED_HostHabitableCheckHandle 1318struct GNUNET_TESTBED_HostHabitableCheckHandle