From b5289a8472ba9871e03afdab99462a7ee96f09df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Gallou=C3=ABt?= Date: Fri, 9 Nov 2018 17:57:11 +0000 Subject: [PATCH] Re-estimate latmin when rate is low MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adrien Gallouët --- mud.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mud.c b/mud.c index 0fe3d5f..aa668be 100644 --- a/mud.c +++ b/mud.c @@ -1405,6 +1405,8 @@ mud_recv(struct mud *mud, void *data, size_t size) } if (path->recv.ratemax > rate) { + if (rate < (7 * path->recv.ratemax) / 8) + path->latmin = (7 * path->latmin + path->lat) / 8; if (path->latmin < path->lat) { const uint64_t a = path->lat - path->latmin; const uint64_t b = path->latmax - path->lat;