From 88a1500d79c9e9b9a3549bbafcc3b72536ecdcb3 Mon Sep 17 00:00:00 2001 From: ThePedroo Date: Thu, 25 Jan 2024 23:15:19 -0300 Subject: [PATCH] fix(loop): not breaking loop on `DISCORD_SESSION_SHUTDOWN` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit fixes an issue that the discord-loop loop wouldn't be breaken to reconnect, causing the bot to be stuck in the state of disconnected. Co-authored-by: Lucas Müller --- src/discord-loop.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/discord-loop.c b/src/discord-loop.c index d342d40d..93c3668a 100644 --- a/src/discord-loop.c +++ b/src/discord-loop.c @@ -118,6 +118,8 @@ discord_run(struct discord *client) (void)poll_errno; } + if (client->gw.session->status & DISCORD_SESSION_SHUTDOWN) break; + BREAK_ON_FAIL(code, io_poller_perform(client->io_poller)); discord_requestor_dispatch_responses(&client->rest.requestor);