- fix cli arg parse
[oweals/gnunet.git] / src / util / mq.c
index bc13bbb36660835e6bc5307c01b0d6e26f236c45..a4691ff2c2eccef9d447a971c448090f8509b18c 100644 (file)
@@ -268,6 +268,9 @@ impl_send_continue (void *cls,
   struct GNUNET_MQ_Handle *mq = cls;
   struct GNUNET_MQ_Envelope *current_envelope;
 
+  if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
+    return;
+
   mq->continue_task = GNUNET_SCHEDULER_NO_TASK;
   /* call is only valid if we're actually currently sending
    * a message */
@@ -466,6 +469,12 @@ server_client_destroy_impl (struct GNUNET_MQ_Handle *mq,
 {
   struct ServerClientSocketState *state = impl_state;
 
+  if (NULL != state->th)
+  {
+    GNUNET_SERVER_notify_transmit_ready_cancel (state->th);
+    state->th = NULL;
+  }
+
   GNUNET_assert (NULL != mq);
   GNUNET_assert (NULL != state);
   GNUNET_SERVER_client_drop (state->client);