From a9ab2a063d49495f0ea0e0894d24cbd3c9fc7aa0 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 8 Nov 2018 21:38:44 +0300 Subject: Discord: attempt to eliminate random disconnects --- protocols/Discord/src/gateway.cpp | 2 ++ protocols/Discord/src/server.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'protocols') diff --git a/protocols/Discord/src/gateway.cpp b/protocols/Discord/src/gateway.cpp index 4c801c32ce..4506a1a361 100644 --- a/protocols/Discord/src/gateway.cpp +++ b/protocols/Discord/src/gateway.cpp @@ -204,6 +204,7 @@ bool CDiscordProto::GatewayThreadWorker() int bufSize = Netlib_Recv(m_hGatewayConnection, (char*)buf + offset, _countof(buf) - offset, MSG_NODUMP); if (bufSize == 0) { debugLogA("Gateway connection gracefully closed"); + bExit = !m_bTerminated; break; } if (bufSize < 0) { @@ -228,6 +229,7 @@ bool CDiscordProto::GatewayThreadWorker() int result = Netlib_Recv(m_hGatewayConnection, (char*)buf, _countof(buf), MSG_NODUMP); if (result == 0) { debugLogA("Gateway connection gracefully closed"); + bExit = !m_bTerminated; break; } if (result < 0) { diff --git a/protocols/Discord/src/server.cpp b/protocols/Discord/src/server.cpp index 02edcdaed0..19e96cdb28 100644 --- a/protocols/Discord/src/server.cpp +++ b/protocols/Discord/src/server.cpp @@ -67,7 +67,7 @@ void CDiscordProto::OnReceiveHistory(NETLIBHTTPREQUEST *pReply, AsyncHttpRequest if (!pUser->bIsPrivate) { si = g_chatApi.SM_FindSession(pUser->wszUsername, m_szModuleName); if (si == nullptr) { - debugLogA("nessage to unknown channal %lld ignored", pUser->channelId); + debugLogA("nessage to unknown channel %lld ignored", pUser->channelId); return; } } -- cgit v1.2.3