gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r21288 - gnunet/src/transport


From: gnunet
Subject: [GNUnet-SVN] r21288 - gnunet/src/transport
Date: Sun, 6 May 2012 14:07:44 +0200

Author: grothoff
Date: 2012-05-06 14:07:44 +0200 (Sun, 06 May 2012)
New Revision: 21288

Modified:
   gnunet/src/transport/plugin_transport_wlan.c
Log:
-removing odd error message, fixing english, removing dead code

Modified: gnunet/src/transport/plugin_transport_wlan.c
===================================================================
--- gnunet/src/transport/plugin_transport_wlan.c        2012-05-06 12:03:41 UTC 
(rev 21287)
+++ gnunet/src/transport/plugin_transport_wlan.c        2012-05-06 12:07:44 UTC 
(rev 21288)
@@ -40,12 +40,7 @@
 #include "gnunet_fragmentation_lib.h"
 #include "gnunet_constants.h"
 
-/**
- * DEBUG switch
- */
-#define DEBUG_WLAN GNUNET_EXTRA_LOGGING
 
-
 #define PROTOCOL_PREFIX "wlan"
 
 #define PLUGIN_LOG_NAME "wlan-plugin"
@@ -662,61 +657,7 @@
 finish_sending (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
 
 
-/**
- * Generates a nice hexdump of a memory area.
- *
- * \param  mem     pointer to memory to dump
- * \param  length  how many bytes to dump
- */
-static void
-hexdump (const void *mem, unsigned length)
-{
-  char line[80];
-  char *src = (char *) mem;
 
-  printf ("dumping %u bytes from %p\r\n"
-          "       0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F    
0123456789ABCDEF\r\n",
-          length, src);
-  unsigned i;
-  int j;
-
-  for (i = 0; i < length; i += 16, src += 16)
-  {
-    char *t = line;
-
-    t += sprintf (t, "%04x:  ", i);
-    for (j = 0; j < 16; j++)
-    {
-      if (i + j < length)
-        t += sprintf (t, "%02X", src[j] & 0xff);
-      else
-        t += sprintf (t, "  ");
-
-      t += sprintf (t, (j % 2) ? " " : "-");
-    }
-
-    t += sprintf (t, "  ");
-    for (j = 0; j < 16; j++)
-    {
-      if (i + j < length)
-      {
-        if (isprint ((unsigned char) src[j]))
-          t += sprintf (t, "%c", src[j]);
-        else
-          t += sprintf (t, ".");
-      }
-      else
-      {
-        t += sprintf (t, " ");
-      }
-    }
-
-    t += sprintf (t, "\r\n");
-    printf ("%s", line);
-  }
-}
-
-
 /**
  * Function to find a MacEndpoint with a specific mac addr
  * @param plugin pointer to the plugin struct
@@ -1065,6 +1006,7 @@
   }
 }
 
+
 /**
  * Function to get the next queued Session, removes the session from the queue
  * @param plugin pointer to the plugin struct
@@ -1075,7 +1017,7 @@
 {
   struct Session *session;
   struct Sessionqueue *sessionqueue;
-  struct Sessionqueue *sessionqueue_alt;
+  struct Sessionqueue *sessionqueue_old;
   struct PendingMessage *pm;
 
   sessionqueue = plugin->pending_Sessions_head;
@@ -1089,21 +1031,17 @@
 
     if (pm == NULL)
     {
-      GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, PLUGIN_LOG_NAME,
-                       "pending message is empty, should not happen. session 
%p\n",
-                       session);
-      sessionqueue_alt = sessionqueue;
+      sessionqueue_old = sessionqueue;
       sessionqueue = sessionqueue->next;
       plugin->pendingsessions--;
       GNUNET_STATISTICS_set (plugin->env->stats, _("# wlan pending sessions"),
                              plugin->pendingsessions, GNUNET_NO);
       GNUNET_CONTAINER_DLL_remove (plugin->pending_Sessions_head,
                                    plugin->pending_Sessions_tail,
-                                   sessionqueue_alt);
+                                   sessionqueue_old);
 
-      GNUNET_free (sessionqueue_alt);
+      GNUNET_free (sessionqueue_old);
       continue;
-
     }
 
     //check for message timeout
@@ -1144,16 +1082,16 @@
 
       if (session->pending_message_head == NULL)
       {
-        sessionqueue_alt = sessionqueue;
+        sessionqueue_old = sessionqueue;
         sessionqueue = sessionqueue->next;
         plugin->pendingsessions--;
         GNUNET_STATISTICS_set (plugin->env->stats, _("# wlan pending 
sessions"),
                                plugin->pendingsessions, GNUNET_NO);
         GNUNET_CONTAINER_DLL_remove (plugin->pending_Sessions_head,
                                      plugin->pending_Sessions_tail,
-                                     sessionqueue_alt);
+                                     sessionqueue_old);
 
-        GNUNET_free (sessionqueue_alt);
+        GNUNET_free (sessionqueue_old);
       }
     }
 
@@ -1161,6 +1099,7 @@
   return NULL;
 }
 
+
 /**
  * frees the space of a message in the fragment queue (send queue)
  * @param plugin the plugin struct
@@ -1771,12 +1710,12 @@
   free_fragment_message (fm->session->mac->plugin, fm);
 }
 
+
 /**
  * Function to check if there is some space in the fragment queue
  * inserts a message if space is available
  * @param plugin the plugin struct
  */
-
 static void
 check_fragment_queue (struct Plugin *plugin)
 {
@@ -2141,9 +2080,6 @@
   GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, PLUGIN_LOG_NAME,
                    "New message for %p with size (incl wlan header) %u 
added\n",
                    session, newmsg->message_size);
-#if DEBUG_WLAN > 1
-  hexdump (msgbuf, GNUNET_MIN (msgbuf_size, 256));
-#endif
   //queue session
   queue_session (plugin, session);
 
@@ -2419,7 +2355,6 @@
                        GNUNET_CRYPTO_crc32_n ((char *) wlanheader,
                                               ntohs (wlanheader->header.size)),
                        crc);
-      hexdump ((void *) hdr, ntohs (hdr->size));
       return;
     }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]