handle transmissions initiated during disconnect callbacks by dropping
authorChristian Grothoff <christian@grothoff.org>
Mon, 9 Jan 2017 07:32:21 +0000 (08:32 +0100)
committerChristian Grothoff <christian@grothoff.org>
Mon, 9 Jan 2017 20:17:25 +0000 (21:17 +0100)
src/core/core_api_2.c

index d810bf2ec783506b4ea49c6b126b3354f638616d..7826cd03e396551a72ebd5f5975db6de12ed370e 100644 (file)
@@ -299,6 +299,12 @@ core_mq_send_impl (struct GNUNET_MQ_Handle *mq,
   int cork;
   enum GNUNET_CORE_Priority priority;
 
+  if (NULL == h->mq)
+  {
+    /* We're currently reconnecting, pretend this worked */
+    GNUNET_MQ_impl_send_continue (mq);
+    return;
+  }
   GNUNET_assert (NULL == pr->env);
   /* extract options from envelope */
   env = GNUNET_MQ_get_current_envelope (mq);