diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2012-10-26 07:02:30 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2012-10-26 07:02:30 +0000 |
commit | 343c0ca07b9961678db978b64bc30dc3dd48e3cf (patch) | |
tree | 7d23c65c0a258f8ed7ed7d7a943d72fa27cad99c | |
parent | 2357d39265bfae86a8084b2d345c3b065fc9502d (diff) |
use calculated delays /w wlan
-rw-r--r-- | src/transport/plugin_transport_wlan.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/src/transport/plugin_transport_wlan.c b/src/transport/plugin_transport_wlan.c index 3e8cd50e25..dd4d995794 100644 --- a/src/transport/plugin_transport_wlan.c +++ b/src/transport/plugin_transport_wlan.c @@ -340,6 +340,16 @@ struct MacEndpoint struct GNUNET_TRANSPORT_WLAN_MacAddress addr; /** + * Message delay for fragmentation context + */ + struct GNUNET_TIME_Relative msg_delay; + + /** + * ACK delay for fragmentation context + */ + struct GNUNET_TIME_Relative ack_delay; + + /** * Desired transmission power for this MAC */ uint16_t tx_power; @@ -790,7 +800,9 @@ free_fragment_message (struct FragmentMessage *fm) GNUNET_HELPER_send_cancel (fm->sh); fm->sh = NULL; } - GNUNET_FRAGMENT_context_destroy (fm->fragcontext, NULL, NULL); + GNUNET_FRAGMENT_context_destroy (fm->fragcontext, + &endpoint->msg_delay, + &endpoint->ack_delay); if (fm->timeout_task != GNUNET_SCHEDULER_NO_TASK) { GNUNET_SCHEDULER_cancel (fm->timeout_task); @@ -861,9 +873,8 @@ send_with_fragmentation (struct MacEndpoint *endpoint, fm->fragcontext = GNUNET_FRAGMENT_context_create (plugin->env->stats, WLAN_MTU, &plugin->tracker, - GNUNET_TIME_UNIT_MILLISECONDS, - GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, - 100), + endpoint->msg_delay, + endpoint->ack_delay, msg, &transmit_fragment, fm); fm->timeout_task = @@ -963,6 +974,10 @@ create_macendpoint (struct Plugin *plugin, pos, &wlan_data_message_handler, &send_ack); + + pos->msg_delay = GNUNET_TIME_UNIT_MILLISECONDS; + pos->ack_delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, + 100); pos->timeout = GNUNET_TIME_relative_to_absolute (MACENDPOINT_TIMEOUT); pos->timeout_task = GNUNET_SCHEDULER_add_delayed (MACENDPOINT_TIMEOUT, &macendpoint_timeout, |