-trying to fix fragmentation / udp performance, not working yet
[oweals/gnunet.git] / src / transport / plugin_transport_wlan.c
index d23608db9118feab70ab11ef135b0501deb02dbd..ccf5d587cb86b7117f019b5bafa4bb274d515ed3 100644 (file)
@@ -790,7 +790,7 @@ free_fragment_message (struct FragmentMessage *fm)
     GNUNET_HELPER_send_cancel (fm->sh);
     fm->sh = NULL;
   }
-  GNUNET_FRAGMENT_context_destroy (fm->fragcontext);
+  GNUNET_FRAGMENT_context_destroy (fm->fragcontext, NULL, NULL);
   if (fm->timeout_task != GNUNET_SCHEDULER_NO_TASK)
   {
     GNUNET_SCHEDULER_cancel (fm->timeout_task);
@@ -829,7 +829,7 @@ fragmentmessage_timeout (void *cls,
  * @param timeout how long can the message wait?
  * @param target peer that should receive the message
  * @param msg message to transmit
- * @param bytes of payload
+ * @param payload_size bytes of payload
  * @param cont continuation to call once the message has
  *        been transmitted (or if the transport is ready
  *        for the next transmission call; or if the
@@ -857,10 +857,13 @@ send_with_fragmentation (struct MacEndpoint *endpoint,
   fm->timeout = GNUNET_TIME_relative_to_absolute (timeout);
   fm->cont = cont;
   fm->cont_cls = cont_cls;
+  /* 1 MBit/s typical data rate, 1430 byte fragments => ~100 ms per message */
   fm->fragcontext =
     GNUNET_FRAGMENT_context_create (plugin->env->stats, WLAN_MTU,
                                    &plugin->tracker,
                                    GNUNET_TIME_UNIT_SECONDS,
+                                   GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS,
+                                                                  100),
                                    msg,
                                    &transmit_fragment, fm);
   fm->timeout_task =
@@ -1745,7 +1748,8 @@ libgnunet_plugin_transport_wlan_init (void *cls)
   plugin->helper_payload_tokenizer = GNUNET_SERVER_mst_create (&process_data, plugin);
   plugin->beacon_task = GNUNET_SCHEDULER_add_now (&send_hello_beacon, 
                                                  plugin);
-  switch (testmode)
+  /* some compilers do not like switch on 'long long'... */
+  switch ((unsigned int) testmode)
   {
   case 0: /* normal */ 
     plugin->helper_argv[0] = (char *) "gnunet-helper-transport-wlan";