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 /src/transport/plugin_transport_wlan.c | |
parent | 2357d39265bfae86a8084b2d345c3b065fc9502d (diff) | |
download | gnunet-343c0ca07b9961678db978b64bc30dc3dd48e3cf.tar.gz gnunet-343c0ca07b9961678db978b64bc30dc3dd48e3cf.zip |
use calculated delays /w wlan
Diffstat (limited to 'src/transport/plugin_transport_wlan.c')
-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 3e8cd50e2..dd4d99579 100644 --- a/src/transport/plugin_transport_wlan.c +++ b/src/transport/plugin_transport_wlan.c | |||
@@ -340,6 +340,16 @@ struct MacEndpoint | |||
340 | struct GNUNET_TRANSPORT_WLAN_MacAddress addr; | 340 | struct GNUNET_TRANSPORT_WLAN_MacAddress addr; |
341 | 341 | ||
342 | /** | 342 | /** |
343 | * Message delay for fragmentation context | ||
344 | */ | ||
345 | struct GNUNET_TIME_Relative msg_delay; | ||
346 | |||
347 | /** | ||
348 | * ACK delay for fragmentation context | ||
349 | */ | ||
350 | struct GNUNET_TIME_Relative ack_delay; | ||
351 | |||
352 | /** | ||
343 | * Desired transmission power for this MAC | 353 | * Desired transmission power for this MAC |
344 | */ | 354 | */ |
345 | uint16_t tx_power; | 355 | uint16_t tx_power; |
@@ -790,7 +800,9 @@ free_fragment_message (struct FragmentMessage *fm) | |||
790 | GNUNET_HELPER_send_cancel (fm->sh); | 800 | GNUNET_HELPER_send_cancel (fm->sh); |
791 | fm->sh = NULL; | 801 | fm->sh = NULL; |
792 | } | 802 | } |
793 | GNUNET_FRAGMENT_context_destroy (fm->fragcontext, NULL, NULL); | 803 | GNUNET_FRAGMENT_context_destroy (fm->fragcontext, |
804 | &endpoint->msg_delay, | ||
805 | &endpoint->ack_delay); | ||
794 | if (fm->timeout_task != GNUNET_SCHEDULER_NO_TASK) | 806 | if (fm->timeout_task != GNUNET_SCHEDULER_NO_TASK) |
795 | { | 807 | { |
796 | GNUNET_SCHEDULER_cancel (fm->timeout_task); | 808 | GNUNET_SCHEDULER_cancel (fm->timeout_task); |
@@ -861,9 +873,8 @@ send_with_fragmentation (struct MacEndpoint *endpoint, | |||
861 | fm->fragcontext = | 873 | fm->fragcontext = |
862 | GNUNET_FRAGMENT_context_create (plugin->env->stats, WLAN_MTU, | 874 | GNUNET_FRAGMENT_context_create (plugin->env->stats, WLAN_MTU, |
863 | &plugin->tracker, | 875 | &plugin->tracker, |
864 | GNUNET_TIME_UNIT_MILLISECONDS, | 876 | endpoint->msg_delay, |
865 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, | 877 | endpoint->ack_delay, |
866 | 100), | ||
867 | msg, | 878 | msg, |
868 | &transmit_fragment, fm); | 879 | &transmit_fragment, fm); |
869 | fm->timeout_task = | 880 | fm->timeout_task = |
@@ -963,6 +974,10 @@ create_macendpoint (struct Plugin *plugin, | |||
963 | pos, | 974 | pos, |
964 | &wlan_data_message_handler, | 975 | &wlan_data_message_handler, |
965 | &send_ack); | 976 | &send_ack); |
977 | |||
978 | pos->msg_delay = GNUNET_TIME_UNIT_MILLISECONDS; | ||
979 | pos->ack_delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, | ||
980 | 100); | ||
966 | pos->timeout = GNUNET_TIME_relative_to_absolute (MACENDPOINT_TIMEOUT); | 981 | pos->timeout = GNUNET_TIME_relative_to_absolute (MACENDPOINT_TIMEOUT); |
967 | pos->timeout_task = | 982 | pos->timeout_task = |
968 | GNUNET_SCHEDULER_add_delayed (MACENDPOINT_TIMEOUT, &macendpoint_timeout, | 983 | GNUNET_SCHEDULER_add_delayed (MACENDPOINT_TIMEOUT, &macendpoint_timeout, |