From 6a27062f486a1abba07defac4ca0458b0e43ecb6 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Sun, 14 Nov 2021 15:39:20 +0100 Subject: [PATCH] Stop connection attempts if interrupted If the interruptor is interrupted, every network call will fail, but the retry-on-error mechanism must also be stopped. --- app/src/server.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/server.c b/app/src/server.c index 58247a72..d792364d 100644 --- a/app/src/server.c +++ b/app/src/server.c @@ -234,6 +234,12 @@ connect_to_server(struct sc_server *server, uint32_t attempts, sc_tick delay) { net_close(socket); } + + if (sc_intr_is_interrupted(&server->intr)) { + // Stop immediately + break; + } + if (attempts) { sc_mutex_lock(&server->mutex); sc_tick deadline = sc_tick_now() + delay;