- debug
authorBart Polot <bart@net.in.tum.de>
Thu, 18 Jul 2013 12:22:33 +0000 (12:22 +0000)
committerBart Polot <bart@net.in.tum.de>
Thu, 18 Jul 2013 12:22:33 +0000 (12:22 +0000)
src/mesh/mesh_api.c

index e7a3ae806269b7aceae3e0da9ae203aa192f9f29..ec4396a705feefe66537eb499c8396a0df7a35cd 100644 (file)
@@ -1195,17 +1195,22 @@ send_callback (void *cls, size_t size, void *buf)
         GNUNET_assert (size >= psize);
         dmsg->header.size = htons (psize);
         dmsg->tid = htonl (t->tid);
+        dmsg->header.type = htons (GNUNET_MESSAGE_TYPE_MESH_LOCAL_DATA);
+        LOG (GNUNET_ERROR_TYPE_DEBUG, "#  payload type %s\n",
+             GNUNET_MESH_DEBUG_M2S (ntohs (mh->type)));
+      }
+      else
+      {
+        LOG (GNUNET_ERROR_TYPE_DEBUG,
+             "#  callback returned size 0, "
+             "application canceled transmission\n");
       }
-      dmsg->header.type = htons (GNUNET_MESSAGE_TYPE_MESH_LOCAL_DATA);
-      LOG (GNUNET_ERROR_TYPE_DEBUG, "#  payload type %s\n",
-           GNUNET_MESH_DEBUG_M2S (ntohs (mh->type)));
-
     }
     else
     {
       struct GNUNET_MessageHeader *mh = (struct GNUNET_MessageHeader *) &th[1];
 
-      LOG (GNUNET_ERROR_TYPE_DEBUG, "#  mesh traffic, type %s\n",
+      LOG (GNUNET_ERROR_TYPE_DEBUG, "#  mesh internal traffic, type %s\n",
            GNUNET_MESH_DEBUG_M2S (ntohs (mh->type)));
       memcpy (cbuf, &th[1], th->size);
       psize = th->size;