tolerate additional IPv4 address now available for gnunet.org
[oweals/gnunet.git] / src / util / mq.c
index d2f5add19c9c30f25b667e9f9e090ecebff7a887..513c008eeb52748e3265afd7708e4bfb7bc2f511 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     Copyright (C) 2012-2017 GNUnet e.V.
+     Copyright (C) 2012-2019 GNUnet e.V.
 
      GNUnet is free software: you can redistribute it and/or modify it
      under the terms of the GNU Affero General Public License as published
@@ -374,7 +374,14 @@ GNUNET_MQ_send (struct GNUNET_MQ_Handle *mq,
   GNUNET_assert (NULL == ev->parent_queue);
 
   mq->queue_length++;
-  GNUNET_break (mq->queue_length < 10000); /* This would seem like a bug... */
+  if (mq->queue_length >= 10000)
+  {
+    /* This would seem like a bug... */
+    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+               "MQ with %u entries extended by message of type %u (FC broken?)\n",
+               (unsigned int) mq->queue_length,
+               (unsigned int) ntohs (ev->mh->type));
+  }
   ev->parent_queue = mq;
   /* is the implementation busy? queue it! */
   if ( (NULL != mq->current_envelope) ||
@@ -964,6 +971,7 @@ GNUNET_MQ_send_cancel (struct GNUNET_MQ_Envelope *ev)
   {
     /* complex case, we already started with transmitting
        the message using the callbacks. */
+    GNUNET_assert (GNUNET_NO == mq->in_flight);
     GNUNET_assert (0 < mq->queue_length);
     mq->queue_length--;
     mq->cancel_impl (mq,