diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-03-07 19:35:26 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-03-07 19:35:26 +0000 |
commit | 5410702d6c31d4486766e111c6518d4c8814ddf3 (patch) | |
tree | 61f6e955454ce0f2ab5cf0ef33654b3ab44927c3 /src/transport/plugin_transport_udp.c | |
parent | cd0ad4c559f9338eec2a152ded51d16e021eca06 (diff) | |
download | gnunet-5410702d6c31d4486766e111c6518d4c8814ddf3.tar.gz gnunet-5410702d6c31d4486766e111c6518d4c8814ddf3.zip |
trying to fix #3694: reduce duplicate ACKing
Diffstat (limited to 'src/transport/plugin_transport_udp.c')
-rw-r--r-- | src/transport/plugin_transport_udp.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c index 2e7e2acfa..abf3860bc 100644 --- a/src/transport/plugin_transport_udp.c +++ b/src/transport/plugin_transport_udp.c | |||
@@ -1980,6 +1980,12 @@ read_process_ack (struct Plugin *plugin, | |||
1980 | return; | 1980 | return; |
1981 | } | 1981 | } |
1982 | udp_ack = (const struct UDP_ACK_Message *) msg; | 1982 | udp_ack = (const struct UDP_ACK_Message *) msg; |
1983 | ack = (const struct GNUNET_MessageHeader *) &udp_ack[1]; | ||
1984 | if (ntohs (ack->size) != ntohs (msg->size) - sizeof(struct UDP_ACK_Message)) | ||
1985 | { | ||
1986 | GNUNET_break_op(0); | ||
1987 | return; | ||
1988 | } | ||
1983 | address = GNUNET_HELLO_address_allocate (&udp_ack->sender, | 1989 | address = GNUNET_HELLO_address_allocate (&udp_ack->sender, |
1984 | PLUGIN_NAME, | 1990 | PLUGIN_NAME, |
1985 | udp_addr, | 1991 | udp_addr, |
@@ -2000,10 +2006,11 @@ read_process_ack (struct Plugin *plugin, | |||
2000 | if (NULL == s->frag_ctx) | 2006 | if (NULL == s->frag_ctx) |
2001 | { | 2007 | { |
2002 | LOG (GNUNET_ERROR_TYPE_WARNING | GNUNET_ERROR_TYPE_BULK, | 2008 | LOG (GNUNET_ERROR_TYPE_WARNING | GNUNET_ERROR_TYPE_BULK, |
2003 | "Fragmentation context of address %s for ACK not found\n", | 2009 | "Fragmentation context of address %s for ACK (%s) not found\n", |
2004 | udp_address_to_string (plugin, | 2010 | udp_address_to_string (plugin, |
2005 | address->address, | 2011 | address->address, |
2006 | address->address_length)); | 2012 | address->address_length), |
2013 | GNUNET_FRAGMENT_print_ack (ack)); | ||
2007 | GNUNET_HELLO_address_free (address); | 2014 | GNUNET_HELLO_address_free (address); |
2008 | return; | 2015 | return; |
2009 | } | 2016 | } |
@@ -2017,12 +2024,6 @@ read_process_ack (struct Plugin *plugin, | |||
2017 | GNUNET_i2s (&udp_ack->sender)); | 2024 | GNUNET_i2s (&udp_ack->sender)); |
2018 | s->flow_delay_from_other_peer = GNUNET_TIME_relative_to_absolute (flow_delay); | 2025 | s->flow_delay_from_other_peer = GNUNET_TIME_relative_to_absolute (flow_delay); |
2019 | 2026 | ||
2020 | ack = (const struct GNUNET_MessageHeader *) &udp_ack[1]; | ||
2021 | if (ntohs (ack->size) != ntohs (msg->size) - sizeof(struct UDP_ACK_Message)) | ||
2022 | { | ||
2023 | GNUNET_break_op(0); | ||
2024 | return; | ||
2025 | } | ||
2026 | 2027 | ||
2027 | if (GNUNET_OK != | 2028 | if (GNUNET_OK != |
2028 | GNUNET_FRAGMENT_process_ack (s->frag_ctx->frag, | 2029 | GNUNET_FRAGMENT_process_ack (s->frag_ctx->frag, |