void *impl_state);
-/**
- * Callback used for notifications
- *
- * @param cls closure
- */
-typedef void
-(*GNUNET_MQ_NotifyCallback) (void *cls);
-
-
/**
* Generic error handler, called with the appropriate
* error code and the same closure specified at the creation of
*/
void
GNUNET_MQ_notify_sent (struct GNUNET_MQ_Envelope *ev,
- GNUNET_MQ_NotifyCallback cb,
+ GNUNET_SCHEDULER_TaskCallback cb,
void *cb_cls);
struct GNUNET_MQ_Envelope *
GNUNET_PEERINFO_add_peer (struct GNUNET_PEERINFO_Handle *h,
const struct GNUNET_HELLO_Message *hello,
- GNUNET_MQ_NotifyCallback cont,
+ GNUNET_SCHEDULER_TaskCallback cont,
void *cont_cls);
if (NULL != last)
{
GNUNET_MQ_notify_sent (last,
- (GNUNET_MQ_NotifyCallback) group_cleanup, grp);
+ (GNUNET_SCHEDULER_TaskCallback) group_cleanup, grp);
}
else
{
struct GNUNET_MQ_Envelope *
GNUNET_PEERINFO_add_peer (struct GNUNET_PEERINFO_Handle *h,
const struct GNUNET_HELLO_Message *hello,
- GNUNET_MQ_NotifyCallback cont,
+ GNUNET_SCHEDULER_TaskCallback cont,
void *cont_cls)
{
struct GNUNET_MQ_Envelope *env;
struct GNUNET_MQ_Envelope *env = GNUNET_MQ_get_last_envelope (chn->mq);
if (NULL != env)
{
- GNUNET_MQ_notify_sent (env, (GNUNET_MQ_NotifyCallback) channel_cleanup, chn);
+ GNUNET_MQ_notify_sent (env, (GNUNET_SCHEDULER_TaskCallback) channel_cleanup, chn);
}
else
{
struct GNUNET_MQ_Envelope *env = GNUNET_MQ_get_last_envelope (plc->mq);
if (NULL != env)
{
- GNUNET_MQ_notify_sent (env, (GNUNET_MQ_NotifyCallback) place_cleanup, plc);
+ GNUNET_MQ_notify_sent (env, (GNUNET_SCHEDULER_TaskCallback) place_cleanup, plc);
}
else
{
struct GNUNET_MQ_Envelope *env = GNUNET_MQ_get_last_envelope (app->mq);
if (NULL != env)
{
- GNUNET_MQ_notify_sent (env, (GNUNET_MQ_NotifyCallback) app_cleanup, app);
+ GNUNET_MQ_notify_sent (env, (GNUNET_SCHEDULER_TaskCallback) app_cleanup, app);
}
else
{
/**
* Called after the message was sent irrevocably.
*/
- GNUNET_MQ_NotifyCallback sent_cb;
+ GNUNET_SCHEDULER_TaskCallback sent_cb;
/**
* Closure for @e send_cb
void *error_handler_cls;
/**
- * Task to asynchronously run #impl_send_continue().
+ * Task to asynchronously run #impl_send_continue().
*/
struct GNUNET_SCHEDULER_Task *send_task;
-
+
/**
* Linked list of messages pending to be sent
*/
impl_send_continue (void *cls)
{
struct GNUNET_MQ_Handle *mq = cls;
-
+
mq->send_task = NULL;
/* call is only valid if we're actually currently sending
* a message */
GNUNET_MQ_impl_send_continue (struct GNUNET_MQ_Handle *mq)
{
struct GNUNET_MQ_Envelope *current_envelope;
- GNUNET_MQ_NotifyCallback cb;
-
+ GNUNET_SCHEDULER_TaskCallback cb;
+
GNUNET_assert (0 < mq->queue_length);
mq->queue_length--;
mq->in_flight = GNUNET_NO;
{
current_envelope->sent_cb = NULL;
cb (current_envelope->sent_cls);
- }
+ }
GNUNET_free (current_envelope);
}
GNUNET_MQ_impl_send_in_flight (struct GNUNET_MQ_Handle *mq)
{
struct GNUNET_MQ_Envelope *current_envelope;
- GNUNET_MQ_NotifyCallback cb;
-
+ GNUNET_SCHEDULER_TaskCallback cb;
+
mq->in_flight = GNUNET_YES;
/* call is only valid if we're actually currently sending
* a message */
*/
void
GNUNET_MQ_notify_sent (struct GNUNET_MQ_Envelope *mqm,
- GNUNET_MQ_NotifyCallback cb,
+ GNUNET_SCHEDULER_TaskCallback cb,
void *cb_cls)
{
mqm->sent_cb = cb;
GNUNET_assert (NULL != mq);
GNUNET_assert (NULL != mq->cancel_impl);
-
+
mq->evacuate_called = GNUNET_NO;
if (mq->current_envelope == ev)