From ec29c1c000f233c012f0b7df8914fe59630e64d2 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 7 Mar 2021 14:13:49 +0300 Subject: more fixes for #2499 --- protocols/Discord/src/gateway.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'protocols/Discord/src/gateway.cpp') diff --git a/protocols/Discord/src/gateway.cpp b/protocols/Discord/src/gateway.cpp index adee0a2018..4f0d32f321 100644 --- a/protocols/Discord/src/gateway.cpp +++ b/protocols/Discord/src/gateway.cpp @@ -68,8 +68,14 @@ bool CDiscordProto::GatewayThreadWorker() } // if there's no cookie & Miranda is bounced with error 404, simply apply the cookie and try again - if (pReply->resultCode != 101) - return pReply->resultCode == 404 && hdrs[1].szName == nullptr; + if (pReply->resultCode != 101) { + if (pReply->resultCode == 404) { // shitty Cloudflare... + if (hdrs[1].szName != nullptr) + m_szWSCookie.Empty(); // don't use the same cookie twice + return true; + } + return false; + } // succeeded! debugLogA("Gateway connection succeeded"); -- cgit v1.2.3