+/**
+ * Task to be executed when flushing our local buffer takes longer than timeout
+ * given to GNUNET_TESTBED_LOGGER_flush(). The flush completion callback will
+ * 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)
+{
+ struct GNUNET_TESTBED_LOGGER_Handle *h = cls;
+ GNUNET_TESTBED_LOGGER_FlushCompletion cb;
+ void *cb_cls;
+
+ h->timeout_flush_task = GNUNET_SCHEDULER_NO_TASK;
+ cb = h->cb;
+ h->cb = NULL;
+ cb_cls = h->cb_cls;
+ h->cb_cls = NULL;
+ if (GNUNET_SCHEDULER_NO_TASK != h->flush_completion_task)
+ {
+ GNUNET_SCHEDULER_cancel (h->flush_completion_task);
+ h->flush_completion_task = GNUNET_SCHEDULER_NO_TASK;
+ }
+ if (NULL != cb)
+ cb (cb_cls, 0);
+}
+
+