From ec30e45e04d2d8fbb1e62c520379a0f0bc99456c Mon Sep 17 00:00:00 2001 From: Sergey Bolhovskoy Date: Sat, 4 Oct 2014 17:36:05 +0000 Subject: VKontakte: add more debuglog lines ShutdownSession() on PollServer() git-svn-id: http://svn.miranda-ng.org/main/trunk@10689 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/VKontakte/src/misc.cpp | 2 +- protocols/VKontakte/src/vk_proto.cpp | 1 + protocols/VKontakte/src/vk_queue.cpp | 4 +++- protocols/VKontakte/src/vk_thread.cpp | 10 ++++------ 4 files changed, 9 insertions(+), 8 deletions(-) (limited to 'protocols/VKontakte') diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp index 75e23daac8..5b417a1971 100644 --- a/protocols/VKontakte/src/misc.cpp +++ b/protocols/VKontakte/src/misc.cpp @@ -99,7 +99,7 @@ bool CVkProto::CheckJsonResult(AsyncHttpRequest *pReq, NETLIBHTTPREQUEST *reply, return true; int iErrorCode = json_as_int(pErrorCode); - + debugLogA("CVkProto::CheckJsonResult %d", iErrorCode); switch (iErrorCode){ case VKERR_AUTHORIZATION_FAILED: ConnectionFailed(LOGINERR_WRONGPASSWORD); diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp index ab93108d33..3d59c48847 100644 --- a/protocols/VKontakte/src/vk_proto.cpp +++ b/protocols/VKontakte/src/vk_proto.cpp @@ -406,6 +406,7 @@ int CVkProto::SetStatus(int iNewStatus) if (iNewStatus == ID_STATUS_OFFLINE) { if ( IsOnline()) { SetServerStatus(ID_STATUS_OFFLINE); + debugLogA("CVkProto::SetStatus ShutdownSession"); ShutdownSession(); } diff --git a/protocols/VKontakte/src/vk_queue.cpp b/protocols/VKontakte/src/vk_queue.cpp index 8669646faa..4cb24e90d7 100644 --- a/protocols/VKontakte/src/vk_queue.cpp +++ b/protocols/VKontakte/src/vk_queue.cpp @@ -60,8 +60,10 @@ LBL_Restart: else if (pReq->bIsMainConn) { if (m_iStatus >= ID_STATUS_CONNECTING && m_iStatus < ID_STATUS_CONNECTING + MAX_CONNECT_RETRIES) ConnectionFailed(LOGINERR_NONETWORK); - else + else { + debugLogA("CVkProto::ExecuteRequest ShutdownSession"); ShutdownSession(); + } } delete pReq; } diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp index ffb9e438a7..cd8a02e0b3 100644 --- a/protocols/VKontakte/src/vk_thread.cpp +++ b/protocols/VKontakte/src/vk_thread.cpp @@ -36,7 +36,7 @@ void CVkProto::ConnectionFailed(int iReason) delSetting("AccessToken"); ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, iReason); - + debugLogA("CVkProto::ConnectionFailed ShutdownSession"); ShutdownSession(); } @@ -92,6 +92,7 @@ void CVkProto::OnLoggedOut() void CVkProto::SetServerStatus(int iNewStatus) { + debugLogA("CVkProto::SetServerStatus %d %d", iNewStatus, m_iStatus); if (!IsOnline() || iNewStatus < ID_STATUS_OFFLINE) return; @@ -1106,11 +1107,8 @@ int CVkProto::PollServer() NETLIBHTTPREQUEST *reply = (NETLIBHTTPREQUEST*)CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM)m_hNetlibUser, (LPARAM)&req); if (reply == NULL) { - debugLogA("CVkProto::PollServer is dead"); - m_pollingConn = NULL; - int oldStatus = m_iStatus; - m_iStatus = m_iDesiredStatus = ID_STATUS_OFFLINE; - ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldStatus, m_iStatus); + debugLogA("CVkProto::PollServer is dead"); + ShutdownSession(); return 0; } -- cgit v1.2.3