[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r18186 - gnunet/src/fragmentation
From: |
gnunet |
Subject: |
[GNUnet-SVN] r18186 - gnunet/src/fragmentation |
Date: |
Thu, 17 Nov 2011 15:53:08 +0100 |
Author: grothoff
Date: 2011-11-17 15:53:08 +0100 (Thu, 17 Nov 2011)
New Revision: 18186
Modified:
gnunet/src/fragmentation/fragmentation.c
Log:
consider number of retransmissions for delay calculation
Modified: gnunet/src/fragmentation/fragmentation.c
===================================================================
--- gnunet/src/fragmentation/fragmentation.c 2011-11-17 14:47:41 UTC (rev
18185)
+++ gnunet/src/fragmentation/fragmentation.c 2011-11-17 14:53:08 UTC (rev
18186)
@@ -100,6 +100,11 @@
unsigned int next_transmission;
/**
+ * How many rounds of transmission have we completed so far?
+ */
+ unsigned int num_rounds;
+
+ /**
* GNUNET_YES if we called 'proc' and are now waiting for
'GNUNET_FRAGMENT_transmission_done'
*/
int8_t proc_busy;
@@ -112,7 +117,7 @@
/**
* Target fragment size.
*/
- uint16_t mtu;
+ uint16_t mtu;
};
@@ -207,6 +212,7 @@
delay = GNUNET_TIME_relative_max (GNUNET_TIME_UNIT_MILLISECONDS, delay);
fc->last_round = GNUNET_TIME_absolute_get ();
fc->wack = GNUNET_YES;
+ fc->num_rounds++;
}
fc->proc_busy = GNUNET_YES;
fc->delay_until = GNUNET_TIME_relative_to_absolute (delay);
@@ -330,7 +336,7 @@
/* normal ACK, can update running average of delay... */
fc->wack = GNUNET_NO;
ndelay = GNUNET_TIME_absolute_get_duration (fc->last_round);
- fc->delay.rel_value = (ndelay.rel_value + 3 * fc->delay.rel_value) / 4;
+ fc->delay.rel_value = (ndelay.rel_value * fc->num_rounds + 3 *
fc->delay.rel_value) / 4;
}
GNUNET_STATISTICS_update (fc->stats,
_("# fragment acknowledgements received"), 1,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r18186 - gnunet/src/fragmentation,
gnunet <=