From b732cb1b690da705ba3d93e5cd41cf9a35985307 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Gallou=C3=ABt?= Date: Sun, 2 Dec 2018 08:27:41 +0000 Subject: [PATCH] Skip down paths MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adrien Gallouët --- mud.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mud.c b/mud.c index 9f688dc..4fbae7e 100644 --- a/mud.c +++ b/mud.c @@ -1316,6 +1316,9 @@ mud_recv(struct mud *mud, void *data, size_t size) if (!path) return 0; + if (path->state <= MUD_DOWN) + return 0; + path->ok = 1; path->stat_count = 0; path->recv.total++; @@ -1424,7 +1427,7 @@ mud_update(struct mud *mud, uint64_t now) for (unsigned i = 0; i < mud->count; i++) { struct mud_path *path = &mud->paths[i]; - if (path->state < MUD_DOWN) + if (path->state <= MUD_DOWN) continue; path->window = 0; @@ -1489,7 +1492,7 @@ mud_send_wait(struct mud *mud) for (unsigned i = 0; i < mud->count; i++) { struct mud_path *path = &mud->paths[i]; - if (path->state < MUD_DOWN || !path->ok) + if (path->state <= MUD_DOWN || !path->ok) continue; if (!path->send.stat_time) // TODO