diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-03-07 19:59:02 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-03-07 19:59:02 +0000 |
commit | 99bc2dfc35d208d676d7726a66eb01b7ad1604c9 (patch) | |
tree | baa28e84f7c1aceb5a3bceda2520ce73adb32031 /src/fragmentation | |
parent | 374e38fc4ad50d77442a6930202581b08d5e9cd1 (diff) | |
download | gnunet-99bc2dfc35d208d676d7726a66eb01b7ad1604c9.tar.gz gnunet-99bc2dfc35d208d676d7726a66eb01b7ad1604c9.zip |
further delay ACKs if we get duplicates
Diffstat (limited to 'src/fragmentation')
-rw-r--r-- | src/fragmentation/defragmentation.c | 7 |
1 files changed, 5 insertions, 2 deletions
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, | |||
542 | bc++; | 542 | bc++; |
543 | 543 | ||
544 | /* notify about complete message */ | 544 | /* notify about complete message */ |
545 | if ( (duplicate == GNUNET_NO) && | 545 | if ( (GNUNET_NO == duplicate) && |
546 | (0 == mc->bits) ) | 546 | (0 == mc->bits) ) |
547 | { | 547 | { |
548 | GNUNET_STATISTICS_update (dc->stats, | 548 | GNUNET_STATISTICS_update (dc->stats, |
@@ -567,12 +567,15 @@ GNUNET_DEFRAGMENT_process_fragment (struct GNUNET_DEFRAGMENT_Context *dc, | |||
567 | linear sequence; ACK now! */ | 567 | linear sequence; ACK now! */ |
568 | delay = GNUNET_TIME_UNIT_ZERO; | 568 | delay = GNUNET_TIME_UNIT_ZERO; |
569 | } | 569 | } |
570 | if (GNUNET_YES == duplicate) | ||
571 | delay = GNUNET_TIME_relative_multiply (delay, | ||
572 | 2); | ||
570 | if (NULL != mc->ack_task) | 573 | if (NULL != mc->ack_task) |
571 | GNUNET_SCHEDULER_cancel (mc->ack_task); | 574 | GNUNET_SCHEDULER_cancel (mc->ack_task); |
572 | mc->ack_task = GNUNET_SCHEDULER_add_delayed (delay, | 575 | mc->ack_task = GNUNET_SCHEDULER_add_delayed (delay, |
573 | &send_ack, | 576 | &send_ack, |
574 | mc); | 577 | mc); |
575 | if (duplicate == GNUNET_YES) | 578 | if (GNUNET_YES == duplicate) |
576 | return GNUNET_NO; | 579 | return GNUNET_NO; |
577 | return GNUNET_YES; | 580 | return GNUNET_YES; |
578 | } | 581 | } |