/*
This file is part of GNUnet.
- Copyright (C) 2010, 2011, 2012 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2010, 2011, 2012 GNUnet e.V.
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
* @param tc scheduler context (unused)
*/
static void
-report_uri (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+report_uri (void *cls)
{
struct TestPublishOperation *po = cls;
* Task scheduled to run when publish operation times out.
*
* @param cls the publish operation context
- * @param tc scheduler context (unused)
*/
static void
-publish_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+publish_timeout (void *cls)
{
struct TestPublishOperation *po = cls;
po->publish_timeout_task = NULL;
po->publish_uri =
GNUNET_FS_uri_dup (info->value.publish.specifics.completed.chk_uri);
- GNUNET_SCHEDULER_add_continuation (&report_uri, po,
- GNUNET_SCHEDULER_REASON_PREREQ_DONE);
+ GNUNET_SCHEDULER_add_now (&report_uri,
+ po);
break;
case GNUNET_FS_STATUS_PUBLISH_PROGRESS:
if (po->verbose)
* Task scheduled to run when download operation times out.
*
* @param cls the download operation context
- * @param tc scheduler context (unused)
*/
static void
-download_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+download_timeout (void *cls)
{
struct TestDownloadOperation *dop = cls;
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Timeout while trying to download file\n");
dop->download_timeout_task = NULL;
- GNUNET_FS_download_stop (dop->download_context, GNUNET_YES);
- GNUNET_SCHEDULER_add_continuation (dop->download_cont,
- dop->download_cont_cls,
- GNUNET_SCHEDULER_REASON_TIMEOUT);
+ GNUNET_FS_download_stop (dop->download_context,
+ GNUNET_YES);
+ GNUNET_SCHEDULER_add_now (dop->download_cont,
+ dop->download_cont_cls);
GNUNET_TESTBED_operation_done (dop->fs_op);
GNUNET_FS_uri_destroy (dop->uri);
GNUNET_free (dop);
* Task scheduled to report on the completion of our download operation.
*
* @param cls the download operation context
- * @param tc scheduler context (unused)
*/
static void
-report_success (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+report_success (void *cls)
{
struct TestDownloadOperation *dop = cls;
- GNUNET_FS_download_stop (dop->download_context, GNUNET_YES);
- GNUNET_SCHEDULER_add_continuation (dop->download_cont,
- dop->download_cont_cls,
- GNUNET_SCHEDULER_REASON_PREREQ_DONE);
+ GNUNET_FS_download_stop (dop->download_context,
+ GNUNET_YES);
+ GNUNET_SCHEDULER_add_now (dop->download_cont,
+ dop->download_cont_cls);
GNUNET_TESTBED_operation_done (dop->fs_op);
GNUNET_FS_uri_destroy (dop->uri);
GNUNET_free (dop);
* @param info information about the event
*/
static void *
-download_progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info)
+download_progress_cb (void *cls,
+ const struct GNUNET_FS_ProgressInfo *info)
{
struct TestDownloadOperation *dop = cls;
{
case GNUNET_FS_STATUS_DOWNLOAD_PROGRESS:
if (dop->verbose)
- GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Download at %llu/%llu bytes\n",
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Download at %llu/%llu bytes\n",
(unsigned long long) info->value.download.completed,
(unsigned long long) info->value.download.size);
break;
case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED:
GNUNET_SCHEDULER_cancel (dop->download_timeout_task);
dop->download_timeout_task = NULL;
- GNUNET_SCHEDULER_add_continuation (&report_success, dop,
- GNUNET_SCHEDULER_REASON_PREREQ_DONE);
+ GNUNET_SCHEDULER_add_now (&report_success, dop);
break;
case GNUNET_FS_STATUS_DOWNLOAD_ACTIVE:
case GNUNET_FS_STATUS_DOWNLOAD_INACTIVE: