Fix fixed rate

Signed-off-by: Adrien Gallouët <adrien@gallouet.fr>
This commit is contained in:
Adrien Gallouët
2020-02-29 09:57:08 +00:00
parent 4a7740f70f
commit 2f966bb365

1
mud.c
View File

@@ -1204,6 +1204,7 @@ mud_update_window(struct mud *mud, struct mud_path *path, uint64_t now,
uint64_t rx_dt, uint64_t rx_bytes, uint64_t rx_pkt)
{
if (rx_dt && rx_dt > tx_dt + (tx_dt >> 3)) {
if (!path->conf.fixed_rate)
path->tx.rate = (7 * rx_bytes * MUD_ONE_SEC) / (8 * rx_dt);
} else {
uint64_t tx_acc = path->msg.tx.acc + tx_pkt;