summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-11-08 21:38:44 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-11-08 21:38:44 +0300
commita9ab2a063d49495f0ea0e0894d24cbd3c9fc7aa0 (patch)
tree82aecb42cda36ec1413c9c712648357537a1d51f /protocols
parent4fbd8461b0d058b253dc7d9d39264651769aced8 (diff)
Discord: attempt to eliminate random disconnects
Diffstat (limited to 'protocols')
-rw-r--r--protocols/Discord/src/gateway.cpp2
-rw-r--r--protocols/Discord/src/server.cpp2
2 files changed, 3 insertions, 1 deletions
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;
}
}