/*
This file is part of GNUnet
- (C) 2008--2013 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2008--2013 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
You should have received a copy of the GNU General Public License
along with GNUnet; see the file COPYING. If not, write to the
- Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
*/
/**
/**
* Task to call the flush completion callback
*/
- GNUNET_SCHEDULER_TaskIdentifier flush_completion_task;
+ struct GNUNET_SCHEDULER_Task * flush_completion_task;
/**
* Task to be executed when flushing takes too long
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_flush_task;
+ struct GNUNET_SCHEDULER_Task * timeout_flush_task;
};
cancel_timeout_flush (struct GNUNET_TESTBED_LOGGER_Handle *h)
{
GNUNET_SCHEDULER_cancel (h->timeout_flush_task);
- h->timeout_flush_task = GNUNET_SCHEDULER_NO_TASK;
+ h->timeout_flush_task = NULL;
}
* Task to call the flush completion notification
*
* @param cls the logger handle
- * @param tc the scheduler task context
*/
static void
-call_flush_completion (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+call_flush_completion (void *cls)
{
struct GNUNET_TESTBED_LOGGER_Handle *h = cls;
GNUNET_TESTBED_LOGGER_FlushCompletion cb;
void *cb_cls;
size_t bw;
- h->flush_completion_task = GNUNET_SCHEDULER_NO_TASK;
+ h->flush_completion_task = NULL;
bw = h->bwrote;
h->bwrote = 0;
cb = h->cb;
h->cb = NULL;
cb_cls = h->cb_cls;
h->cb_cls = NULL;
- if (GNUNET_SCHEDULER_NO_TASK != h->timeout_flush_task)
+ if (NULL != h->timeout_flush_task)
cancel_timeout_flush (h);
if (NULL != cb)
cb (cb_cls, bw);
static void
trigger_flush_notification (struct GNUNET_TESTBED_LOGGER_Handle *h)
{
- if (GNUNET_SCHEDULER_NO_TASK != h->flush_completion_task)
+ if (NULL != h->flush_completion_task)
GNUNET_SCHEDULER_cancel (h->flush_completion_task);
h->flush_completion_task = GNUNET_SCHEDULER_add_now (&call_flush_completion, h);
}
struct MessageQueue *mq;
unsigned int lost;
- if (GNUNET_SCHEDULER_NO_TASK != h->flush_completion_task)
+ if (NULL != h->flush_completion_task)
GNUNET_SCHEDULER_cancel (h->flush_completion_task);
lost = 0;
while (NULL != (mq = h->mq_head))
* be called with 0 as the amount of data sent.
*
* @param cls the logger handle
- * @param tc scheduler task context
*/
static void
-timeout_flush (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+timeout_flush (void *cls)
{
struct GNUNET_TESTBED_LOGGER_Handle *h = cls;
GNUNET_TESTBED_LOGGER_FlushCompletion cb;
void *cb_cls;
- h->timeout_flush_task = GNUNET_SCHEDULER_NO_TASK;
+ h->timeout_flush_task = NULL;
cb = h->cb;
h->cb = NULL;
cb_cls = h->cb_cls;
h->cb_cls = NULL;
- if (GNUNET_SCHEDULER_NO_TASK != h->flush_completion_task)
+ if (NULL != h->flush_completion_task)
{
GNUNET_SCHEDULER_cancel (h->flush_completion_task);
- h->flush_completion_task = GNUNET_SCHEDULER_NO_TASK;
+ h->flush_completion_task = NULL;
}
if (NULL != cb)
cb (cb_cls, 0);
{
h->cb = cb;
h->cb_cls = cb_cls;
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == h->timeout_flush_task);
+ GNUNET_assert (NULL == h->timeout_flush_task);
h->timeout_flush_task =
GNUNET_SCHEDULER_add_delayed (timeout, &timeout_flush, h);
if (NULL == h->buf)
void
GNUNET_TESTBED_LOGGER_flush_cancel (struct GNUNET_TESTBED_LOGGER_Handle *h)
{
- if (GNUNET_SCHEDULER_NO_TASK != h->flush_completion_task)
+ if (NULL != h->flush_completion_task)
{
GNUNET_SCHEDULER_cancel (h->flush_completion_task);
- h->flush_completion_task = GNUNET_SCHEDULER_NO_TASK;
+ h->flush_completion_task = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != h->timeout_flush_task)
+ if (NULL != h->timeout_flush_task)
cancel_timeout_flush (h);
h->cb = NULL;
h->cb_cls = NULL;