aboutsummaryrefslogtreecommitdiff
path: root/src/testbed/test_testbed_api_controllerlink.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-04-09 23:14:03 +0000
committerChristian Grothoff <christian@grothoff.org>2016-04-09 23:14:03 +0000
commit29e6158507a0758192075ac6ece7ba8e75ddc49a (patch)
treeb91ded48da322f8ba4c9bb0f5504228aa036c2d1 /src/testbed/test_testbed_api_controllerlink.c
parent5dfcb058ab5db9ae0c4b147d8a99c64ca0980028 (diff)
downloadgnunet-29e6158507a0758192075ac6ece7ba8e75ddc49a.tar.gz
gnunet-29e6158507a0758192075ac6ece7ba8e75ddc49a.zip
small API change: do no longer pass rarely needed GNUNET_SCHEDULER_TaskContext to all scheduler tasks; instead, allow the relatively few tasks that need it to obtain the context via GNUNET_SCHEDULER_get_task_context()
Diffstat (limited to 'src/testbed/test_testbed_api_controllerlink.c')
-rw-r--r--src/testbed/test_testbed_api_controllerlink.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/testbed/test_testbed_api_controllerlink.c b/src/testbed/test_testbed_api_controllerlink.c
index 78d4d3bc7..fd876a07f 100644
--- a/src/testbed/test_testbed_api_controllerlink.c
+++ b/src/testbed/test_testbed_api_controllerlink.c
@@ -300,7 +300,7 @@ static enum Stage result;
300 if (NULL != abort_task) \ 300 if (NULL != abort_task) \
301 GNUNET_SCHEDULER_cancel (abort_task); \ 301 GNUNET_SCHEDULER_cancel (abort_task); \
302 abort_task = NULL; \ 302 abort_task = NULL; \
303 GNUNET_SCHEDULER_add_now (do_shutdown, NULL); \ 303 GNUNET_SCHEDULER_add_now (&do_shutdown, NULL); \
304 return; \ 304 return; \
305 } \ 305 } \
306 } while (0) 306 } while (0)
@@ -310,10 +310,9 @@ static enum Stage result;
310 * Shutdown nicely 310 * Shutdown nicely
311 * 311 *
312 * @param cls NULL 312 * @param cls NULL
313 * @param tc the task context
314 */ 313 */
315static void 314static void
316do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 315do_shutdown (void *cls)
317{ 316{
318 if (NULL != abort_task) 317 if (NULL != abort_task)
319 GNUNET_SCHEDULER_cancel (abort_task); 318 GNUNET_SCHEDULER_cancel (abort_task);
@@ -349,14 +348,13 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
349 * abort task to run on test timed out 348 * abort task to run on test timed out
350 * 349 *
351 * @param cls NULL 350 * @param cls NULL
352 * @param tc the task context
353 */ 351 */
354static void 352static void
355do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 353do_abort (void *cls)
356{ 354{
357 LOG (GNUNET_ERROR_TYPE_WARNING, "Aborting\n"); 355 LOG (GNUNET_ERROR_TYPE_WARNING, "Aborting\n");
358 abort_task = NULL; 356 abort_task = NULL;
359 do_shutdown (cls, tc); 357 do_shutdown (cls);
360} 358}
361 359
362 360
@@ -392,7 +390,7 @@ registration_cont (void *cls, const char *emsg);
392 * @return 390 * @return
393 */ 391 */
394static void 392static void
395delay_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 393delay_task (void *cls)
396{ 394{
397 delay_task_id = NULL; 395 delay_task_id = NULL;
398 switch (result) 396 switch (result)
@@ -644,8 +642,8 @@ controller_cb (void *cls, const struct GNUNET_TESTBED_EventInformation *event)
644 result = SUCCESS; 642 result = SUCCESS;
645 GNUNET_TESTBED_operation_done (op); 643 GNUNET_TESTBED_operation_done (op);
646 op = NULL; 644 op = NULL;
647 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply 645 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
648 (GNUNET_TIME_UNIT_SECONDS, 1), &do_shutdown, 646 &do_shutdown,
649 NULL); 647 NULL);
650 break; 648 break;
651 default: 649 default: