GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Could not transmit to transport service, cancelling pending requests\n");
#endif
- th->notify_delay_task = GNUNET_SCHEDULER_NO_TASK;
th = h->connect_ready_head;
if (th->next != NULL)
th->next->prev = NULL;
GNUNET_assert (n->transmit_handle == th);
n->transmit_handle = NULL;
}
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != th->notify_delay_task);
- GNUNET_SCHEDULER_cancel (h->sched,
- th->notify_delay_task);
+ if (th->notify_delay_task != GNUNET_SCHEDULER_NO_TASK)
+ {
+ GNUNET_SCHEDULER_cancel (h->sched,
+ th->notify_delay_task);
+ th->notify_delay_task = GNUNET_SCHEDULER_NO_TASK;
+ }
GNUNET_assert (0 == th->notify (th->notify_cls, 0, NULL));
GNUNET_free (th);
if (h->connect_ready_head != NULL) schedule_transmission (h); /* FIXME: is this ok? */
th = h->connect_ready_head;
if (th->notify_delay_task != GNUNET_SCHEDULER_NO_TASK)
{
- /* remove existing time out task (only applies if
- this is not the first iteration of the loop) */
GNUNET_SCHEDULER_cancel (h->sched,
th->notify_delay_task);
th->notify_delay_task = GNUNET_SCHEDULER_NO_TASK;
"TRY_CONNECT",
GNUNET_i2s(&th->target));
#endif
- th->notify (th->notify_cls, 0, NULL);
if (th->notify_delay_task != GNUNET_SCHEDULER_NO_TASK)
{
GNUNET_SCHEDULER_cancel (h->sched, th->notify_delay_task);
th->notify_delay_task = GNUNET_SCHEDULER_NO_TASK;
}
+ th->notify (th->notify_cls, 0, NULL);
GNUNET_free (th);
return 0;
}
struct GNUNET_CLIENT_Connection *client;
#if DEBUG_TRANSPORT
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Transport disconnect called!\n");
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Transport disconnect called!\n");
#endif
while (NULL != (th = handle->connect_ready_head))
{
handle->connect_ready_head = th->next;
+ GNUNET_assert (th->notify_delay_task == GNUNET_SCHEDULER_NO_TASK);
th->notify (th->notify_cls, 0, NULL);
GNUNET_free (th);
}
/**
- * Cancel the specified transmission-ready
- * notification.
+ * Cancel the specified transmission-ready notification.
*/
void
GNUNET_TRANSPORT_notify_transmit_ready_cancel (struct
h->transmission_scheduled = GNUNET_NO;
}
GNUNET_free (th->notify_cls);
+ GNUNET_assert (th->notify_delay_task == GNUNET_SCHEDULER_NO_TASK);
GNUNET_free (th);
}