- Added debug info
authorBart Polot <bart@net.in.tum.de>
Mon, 23 Jan 2012 17:36:49 +0000 (17:36 +0000)
committerBart Polot <bart@net.in.tum.de>
Mon, 23 Jan 2012 17:36:49 +0000 (17:36 +0000)
src/mesh/mesh_api.c

index 279fb1fe70b76b27fc786647446e345fec1cb011..2c6d906759a27acbcdb3cd66a0b52477c9789855 100644 (file)
@@ -1293,7 +1293,15 @@ GNUNET_MESH_disconnect (struct GNUNET_MESH_Handle *handle)
     GNUNET_break (UINT32_MAX == th->priority);
     GNUNET_break (NULL == th->notify);
     msg = (struct GNUNET_MessageHeader *) &th[1];
-    GNUNET_break (GNUNET_MESSAGE_TYPE_MESH_LOCAL_CONNECT == ntohs(msg->type));
+    if (GNUNET_MESSAGE_TYPE_MESH_LOCAL_CONNECT != ntohs(msg->type))
+    {
+      GNUNET_break (0);
+#if MESH_API_DEBUG
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "mesh: expected %u, got %u\n",
+                  GNUNET_MESSAGE_TYPE_MESH_LOCAL_CONNECT, ntohs(msg->type));
+#endif
+    }
+
     GNUNET_CONTAINER_DLL_remove (handle->th_head, handle->th_tail, th);
     GNUNET_free (th);
   }