From 0b1793a93fb27613b8bca5b762ab2c28e89cf960 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Gallou=C3=ABt?= Date: Sun, 10 Feb 2019 16:11:32 +0000 Subject: [PATCH] Update mud->window when updating path->window MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adrien Gallouët --- mud.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mud.c b/mud.c index d6d689d..e488a80 100644 --- a/mud.c +++ b/mud.c @@ -156,7 +156,7 @@ struct mud { uint64_t time; } decrypt, difftime, keyx; } bad; - unsigned long long window; + uint64_t window; }; static int @@ -418,8 +418,10 @@ mud_send_path(struct mud *mud, struct mud_path *path, uint64_t now, path->send.time = now; if (path->window > size) { + mud->window -= size; path->window -= size; } else { + mud->window -= path->window; path->window = 0; } @@ -1415,7 +1417,7 @@ mud_update(struct mud *mud, uint64_t now) mud_keyx_reset(mud); } - unsigned long long window = 0; + uint64_t window = 0; size_t mtu = 0; for (unsigned i = 0; i < mud->count; i++) {