From 99bc2dfc35d208d676d7726a66eb01b7ad1604c9 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 7 Mar 2015 19:59:02 +0000 Subject: further delay ACKs if we get duplicates --- src/fragmentation/defragmentation.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/fragmentation') diff --git a/src/fragmentation/defragmentation.c b/src/fragmentation/defragmentation.c index 8470fe683..5c4a68416 100644 --- a/src/fragmentation/defragmentation.c +++ b/src/fragmentation/defragmentation.c @@ -542,7 +542,7 @@ GNUNET_DEFRAGMENT_process_fragment (struct GNUNET_DEFRAGMENT_Context *dc, bc++; /* notify about complete message */ - if ( (duplicate == GNUNET_NO) && + if ( (GNUNET_NO == duplicate) && (0 == mc->bits) ) { GNUNET_STATISTICS_update (dc->stats, @@ -567,12 +567,15 @@ GNUNET_DEFRAGMENT_process_fragment (struct GNUNET_DEFRAGMENT_Context *dc, linear sequence; ACK now! */ delay = GNUNET_TIME_UNIT_ZERO; } + if (GNUNET_YES == duplicate) + delay = GNUNET_TIME_relative_multiply (delay, + 2); if (NULL != mc->ack_task) GNUNET_SCHEDULER_cancel (mc->ack_task); mc->ack_task = GNUNET_SCHEDULER_add_delayed (delay, &send_ack, mc); - if (duplicate == GNUNET_YES) + if (GNUNET_YES == duplicate) return GNUNET_NO; return GNUNET_YES; } -- cgit v1.2.3