- use STATIC buffer, remove debug
authorBart Polot <bart@net.in.tum.de>
Fri, 20 Dec 2013 04:46:56 +0000 (04:46 +0000)
committerBart Polot <bart@net.in.tum.de>
Fri, 20 Dec 2013 04:46:56 +0000 (04:46 +0000)
src/mesh/gnunet-mesh.c
src/mesh/mesh_api.c

index 669ab9a01e68f5f400934f65579ffacb9a6bb800..b60a8c0e49d1b91c7a16ee69d702213791140b26 100644 (file)
@@ -170,7 +170,7 @@ static void
 read_stdio (void *cls,
             const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
-  char buf[60000];
+  static char buf[60000];
 
   if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
   {
@@ -179,12 +179,6 @@ read_stdio (void *cls,
 
   data_size = read (0, buf, 60000);
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "stdio read %u bytes\n", data_size);
-  {
-    struct GNUNET_HashCode hash;
-    GNUNET_CRYPTO_hash (buf, data_size, &hash);
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "  cli SEND %p hash %s (%u)\n",
-                buf, GNUNET_h2s_full (&hash), data_size);
-  }
   if (data_size < 1)
   {
     GNUNET_SCHEDULER_shutdown();
@@ -341,16 +335,6 @@ data_callback (void *cls,
   len = ntohs (message->size) - sizeof (*message);
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Got %u bytes\n", len);
   write (1, (char *) &message[1], len);
-  {
-    struct GNUNET_HashCode hash;
-
-    GNUNET_CRYPTO_hash (message, ntohs (message->size), &hash);
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "  api RECV %p hash %s (%u)\n",
-                message, GNUNET_h2s_full (&hash), ntohs (message->size));
-    GNUNET_CRYPTO_hash (&message[1], len, &hash);
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "  cli RECV %p hash %s (%u)\n",
-                &message[1], GNUNET_h2s_full (&hash), len);
-  }
   return GNUNET_OK;
 }
 
index c3274f1c516c00586ae95d93450a8b38f0076941..cd68e253ed2a16e43adb7cb31288b9265241a8f8 100644 (file)
@@ -832,7 +832,6 @@ process_incoming_data (struct GNUNET_MESH_Handle *h,
   const struct GNUNET_MESH_MessageHandler *handler;
   struct GNUNET_MESH_LocalData *dmsg;
   struct GNUNET_MESH_Channel *ch;
-  struct GNUNET_HashCode hash;
   size_t size;
   unsigned int i;
   uint16_t type;
@@ -864,9 +863,6 @@ process_incoming_data (struct GNUNET_MESH_Handle *h,
          handler->type);
     if (handler->type == type)
     {
-      GNUNET_CRYPTO_hash (payload, size, &hash);
-      LOG (GNUNET_ERROR_TYPE_DEBUG, "  recv %p hash %s (%u)\n",
-           payload, GNUNET_h2s_full (&hash), size);
       if (GNUNET_OK !=
           handler->callback (h->cls, ch, &ch->ctx, payload))
       {
@@ -1132,12 +1128,6 @@ send_callback (void *cls, size_t size, void *buf)
       psize = th->notify (th->notify_cls,
                           size - sizeof (struct GNUNET_MESH_LocalData),
                           mh);
-      {
-        struct GNUNET_HashCode hash;
-        GNUNET_CRYPTO_hash (mh, psize, &hash);
-        LOG (GNUNET_ERROR_TYPE_DEBUG, "#  hash send %s (%u)\n",
-             GNUNET_h2s_full (&hash), psize);
-      }
       if (psize > 0)
       {
         psize += sizeof (struct GNUNET_MESH_LocalData);