summaryrefslogtreecommitdiff
path: root/protocols/Discord/src/gateway.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Discord/src/gateway.cpp')
-rw-r--r--protocols/Discord/src/gateway.cpp2
1 files changed, 2 insertions, 0 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) {