From 9ff6f169d1e2bd5bc139290d4abd6d7573fa6061 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 1 Jun 2018 13:04:54 +0300 Subject: fixes #1388 (MSN: crash on "msn_misc.cpp (580): ThreadData::sendPacketPayload") --- protocols/MSN/src/msn_threads.cpp | 38 +++++++++++++------------------------- 1 file changed, 13 insertions(+), 25 deletions(-) (limited to 'protocols/MSN/src/msn_threads.cpp') diff --git a/protocols/MSN/src/msn_threads.cpp b/protocols/MSN/src/msn_threads.cpp index 4f762b02e8..e0db9495fa 100644 --- a/protocols/MSN/src/msn_threads.cpp +++ b/protocols/MSN/src/msn_threads.cpp @@ -253,36 +253,24 @@ void __cdecl CMsnProto::MSNServerThread(void* arg) LBL_Exit: if (info->mIsMainThread) { - /* - if (!isConnectSuccess && !usingGateway && m_iDesiredStatus != ID_STATUS_OFFLINE) { - msnNsThread = NULL; - usingGateway = true; + msnNsThread = nullptr; - ThreadData* newThread = new ThreadData; - newThread->mType = SERVER_NOTIFICATION; - newThread->mIsMainThread = true; - - newThread->startThread(&CMsnProto::MSNServerThread, this); + if (hKeepAliveThreadEvt) { + msnPingTimeout *= -1; + SetEvent(hKeepAliveThreadEvt); } - else*/ { - if (hKeepAliveThreadEvt) { - msnPingTimeout *= -1; - SetEvent(hKeepAliveThreadEvt); - } - - if (info->s == nullptr) - ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, nullptr, LOGINERR_NONETWORK); - else - MSN_CloseConnections(); - if (hHttpsConnection) { - Netlib_CloseHandle(hHttpsConnection); - hHttpsConnection = nullptr; - } + if (info->s == nullptr) + ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, nullptr, LOGINERR_NONETWORK); + else + MSN_CloseConnections(); - MSN_GoOffline(); - msnNsThread = nullptr; + if (hHttpsConnection) { + Netlib_CloseHandle(hHttpsConnection); + hHttpsConnection = nullptr; } + + MSN_GoOffline(); } debugLogA("Thread [%08X] ending now", GetCurrentThreadId()); -- cgit v1.2.3