gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r17195 - gnunet/src/transport
Date: Wed, 5 Oct 2011 12:26:47 +0200

Author: brodski
Date: 2011-10-05 12:26:47 +0200 (Wed, 05 Oct 2011)
New Revision: 17195

Modified:
   gnunet/src/transport/plugin_transport_wlan.c
Log:
bugfix

Modified: gnunet/src/transport/plugin_transport_wlan.c
===================================================================
--- gnunet/src/transport/plugin_transport_wlan.c        2011-10-05 09:41:31 UTC 
(rev 17194)
+++ gnunet/src/transport/plugin_transport_wlan.c        2011-10-05 10:26:47 UTC 
(rev 17195)
@@ -65,7 +65,7 @@
 /**
  * scaling factor for hello beacon
  */
-#define HALLO_BEACON_SCALING_FACTOR 30
+#define HELLO_BEACON_SCALING_FACTOR 30
 
 /**
  * max size of fragment queue
@@ -748,7 +748,7 @@
 
   while (queue != NULL)
   {
-    GNUNET_assert (queue->sessions_head != NULL);
+    //GNUNET_assert (queue->sessions_head != NULL);
     if (memcmp (addr, &queue->addr, sizeof (struct MacAddress)) == 0)
       return queue;             /* session found */
     queue = queue->next;
@@ -999,7 +999,7 @@
         GNUNET_TIME_absolute_add (GNUNET_TIME_absolute_get (),
                                   GNUNET_TIME_relative_multiply
                                   (GNUNET_TIME_UNIT_SECONDS,
-                                   HALLO_BEACON_SCALING_FACTOR));
+                                   HELLO_BEACON_SCALING_FACTOR));
   }
   //under 30 known peers: every 10 seconds
   else if (plugin->mac_count < 30)
@@ -1008,7 +1008,7 @@
         GNUNET_TIME_absolute_add (GNUNET_TIME_absolute_get (),
                                   GNUNET_TIME_relative_multiply
                                   (GNUNET_TIME_UNIT_SECONDS,
-                                   10 * HALLO_BEACON_SCALING_FACTOR));
+                                   10 * HELLO_BEACON_SCALING_FACTOR));
   }
   //over 30 known peers: once a minute
   else
@@ -1017,7 +1017,7 @@
         GNUNET_TIME_absolute_add (GNUNET_TIME_absolute_get (),
                                   GNUNET_TIME_relative_multiply
                                   (GNUNET_TIME_UNIT_MINUTES,
-                                   HALLO_BEACON_SCALING_FACTOR));
+                                   HELLO_BEACON_SCALING_FACTOR));
   }
 }
 
@@ -1365,7 +1365,7 @@
   uint16_t size;
 
 #if DEBUG_wlan_retransmission > 1
-  GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, PLUGIN_LOG_NAME,
+  GNUNET_loHELLO_BEACON_SCALING_FACTORg_from (GNUNET_ERROR_TYPE_DEBUG, 
PLUGIN_LOG_NAME,
                    "Adding fragment of message %p to send, session %p, 
endpoint %p, type %u\n",
                    fm, fm->session, endpoint, hdr->type);
 #endif
@@ -1394,7 +1394,7 @@
 }
 
 /**
- * function to send a hallo beacon
+ * function to send a hello beacon
  * @param plugin pointer to the plugin struct
  */
 static void
@@ -1408,7 +1408,7 @@
 
   uint16_t size;
   ssize_t bytes;
-  uint16_t hallo_size;
+  uint16_t hello_size;
   struct GNUNET_MessageHeader *msgheader;
   struct ieee80211_frame *ieeewlanheader;
   struct Radiotap_Send *radioHeader;
@@ -1420,11 +1420,11 @@
   GNUNET_STATISTICS_update (plugin->env->stats, _("# wlan hello beacons 
send"), 1, GNUNET_NO);
 
   hello = plugin->env->get_our_hello ();
-  hallo_size = GNUNET_HELLO_size ((struct GNUNET_HELLO_Message *) hello);
-  GNUNET_assert (sizeof (struct WlanHeader) + hallo_size <= WLAN_MTU);
+  hello_size = GNUNET_HELLO_size ((struct GNUNET_HELLO_Message *) hello);
+  GNUNET_assert (sizeof (struct WlanHeader) + hello_size <= WLAN_MTU);
   size =
       sizeof (struct GNUNET_MessageHeader) + sizeof (struct Radiotap_Send) +
-      sizeof (struct ieee80211_frame) + hallo_size;
+      sizeof (struct ieee80211_frame) + hello_size;
 
   msgheader = GNUNET_malloc (size);
   msgheader->size = htons (size);
@@ -1441,7 +1441,7 @@
              sizeof (struct GNUNET_MessageHeader));
 
   msgheader2->type = htons (GNUNET_MESSAGE_TYPE_WLAN_ADVERTISEMENT);*/
-  memcpy (msgheader2, hello, hallo_size);
+  memcpy (msgheader2, hello, hello_size);
 
   bytes = GNUNET_DISK_file_write (plugin->server_stdin_handle, msgheader, 
size);
 
@@ -1559,12 +1559,12 @@
     if (session != NULL)
     {
       pm = session->pending_message_head;
+      GNUNET_assert (pm != NULL);
       GNUNET_CONTAINER_DLL_remove (session->pending_message_head,
                                    session->pending_message_tail, pm);
       session->mac->fragment_messages_out_count++;
       session->fragment_messages_out_count++;
       plugin->pending_Fragment_Messages++;
-      GNUNET_assert (pm != NULL);
 
       fm = GNUNET_malloc (sizeof (struct FragmentMessage));
       fm->session = session;
@@ -1771,9 +1771,14 @@
                        _
                        ("Error writing to wlan healper. errno == %d, ERROR: 
%s\n"),
                        errno, strerror (errno));
-
+      //TODO START NEW WLAN HELPER
+      /*
+       * alle sessions beenden
+       * neu starten (alle 5 sec)
+       * alles bis dahin ablehnen
+       */
     }
-    GNUNET_assert (bytes != GNUNET_SYSERR);
+    //GNUNET_assert (bytes != GNUNET_SYSERR);
 
     if (bytes != fm->size)
     {
@@ -2058,15 +2063,19 @@
 
   GNUNET_CONTAINER_DLL_remove (endpoint->sessions_head, 
endpoint->sessions_tail,
                                queue);
-
+  //Check that no ohter session on this endpoint for this session exits
+  GNUNET_assert(search_session(plugin, endpoint, &queue->content->target) == 
NULL);
   if (endpoint->sessions_head == NULL && do_free_macendpoint == GNUNET_YES)
   {
     free_macendpoint (plugin, endpoint);
+    //check if no endpoint with the same address exists
+    GNUNET_assert(get_macendpoint(plugin, &endpoint->addr, GNUNET_NO) == NULL);
   }
 
   if (queue->content->timeout_task != GNUNET_SCHEDULER_NO_TASK)
     GNUNET_SCHEDULER_cancel (queue->content->timeout_task);
   GNUNET_free (queue);
+
   check_fragment_queue (plugin);
 }
 
@@ -2400,7 +2409,7 @@
         {
           session_light->session = create_session (plugin, 
session_light->macendpoint, &tmpsource);
         }
-      GNUNET_STATISTICS_update (plugin->env->stats, _("# wlan hallo messages 
received"), 1, GNUNET_NO);
+      GNUNET_STATISTICS_update (plugin->env->stats, _("# wlan hello messages 
received"), 1, GNUNET_NO);
       
plugin->env->receive(plugin->env->cls,&session_light->session->target,hdr, 
NULL, 0, session_light->session,
           (const char *) &session_light->session->mac->addr,
           sizeof (session_light->session->mac->addr));




reply via email to

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