summaryrefslogtreecommitdiff
path: root/src/util/mq.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/mq.c')
-rw-r--r--src/util/mq.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/util/mq.c b/src/util/mq.c
index 8a46414d2..1638d7e0c 100644
--- a/src/util/mq.c
+++ b/src/util/mq.c
@@ -807,9 +807,18 @@ connection_client_cancel_impl (struct GNUNET_MQ_Handle *mq,
{
struct ClientConnectionState *state = impl_state;
- GNUNET_assert (NULL != state->th);
- GNUNET_CLIENT_notify_transmit_ready_cancel (state->th);
- state->th = NULL;
+ if (NULL != state->th)
+ {
+ GNUNET_CLIENT_notify_transmit_ready_cancel (state->th);
+ state->th = NULL;
+ }
+ else if (NULL != mq->continue_task)
+ {
+ GNUNET_SCHEDULER_cancel (mq->continue_task);
+ mq->continue_task = NULL;
+ }
+ else
+ GNUNET_assert (0);
}