- fixes, debug
[oweals/gnunet.git] / src / mesh / test_mesh2_local.c
index 30624f6ebbd201be6b8c7cc0982ff09527909b21..b62cc9ac82a0539a1be5d3239a04af331b20d9bb 100644 (file)
@@ -114,6 +114,7 @@ data_callback (void *cls, struct GNUNET_MESH_Tunnel *tunnel, void **tunnel_ctx,
   shutdown_task =
     GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, &do_shutdown,
                                   NULL);
+  GNUNET_MESH_receive_done (tunnel);
   return GNUNET_OK;
 }
 
@@ -185,14 +186,22 @@ static struct GNUNET_MESH_MessageHandler handlers1[] = {
 /**
  * Handler array for traffic received on peer2 (none expected)
  */
-static struct GNUNET_MESH_MessageHandler handlers2[] = { {NULL, 0, 0} };
-
+static struct GNUNET_MESH_MessageHandler handlers2[] = {
+  {&data_callback, 1, 0},
+  {NULL, 0, 0}
+};
 
 static size_t
 do_send (void *cls, size_t size, void *buf)
 {
   struct GNUNET_MessageHeader *m = buf;
 
+  if (NULL == buf)
+  {
+    GNUNET_break (0);
+    result = GNUNET_SYSERR;
+    return 0;
+  }
   m->size = htons (sizeof (struct GNUNET_MessageHeader));
   m->type = htons (1);
   GNUNET_assert (size >= sizeof (struct GNUNET_MessageHeader));