From 3a3ae2263b70483741017e01340d4898248138d2 Mon Sep 17 00:00:00 2001 From: Sergey Bolhovskoy Date: Fri, 7 Nov 2014 13:52:15 +0000 Subject: VKontakte: fix for stillbirth PollServer more debug lines in OnReceivePollingInfo git-svn-id: http://svn.miranda-ng.org/main/trunk@10922 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/VKontakte/src/vk_thread.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'protocols') diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp index 2dd4d70a00..a8b56f734d 100644 --- a/protocols/VKontakte/src/vk_thread.cpp +++ b/protocols/VKontakte/src/vk_thread.cpp @@ -848,8 +848,25 @@ void CVkProto::OnReceivePollingInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest * m_pollingTs = mir_t2a(ptrT(json_as_string(json_get(pResponse, "ts")))); m_pollingKey = mir_t2a(ptrT(json_as_string(json_get(pResponse, "key")))); m_pollingServer = mir_t2a(ptrT(json_as_string(json_get(pResponse, "server")))); - if (!m_hPollingThread && m_pollingTs != NULL && m_pollingKey != NULL && m_pollingServer != NULL) - m_hPollingThread = ForkThreadEx(&CVkProto::PollingThread, NULL, NULL); + if (!m_hPollingThread) { + debugLogA("CVkProto::OnReceivePollingInfo m_hPollingThread is NULL"); + debugLogA("CVkProto::OnReceivePollingInfo m_pollingTs = \'%s' m_pollingKey = \'%s\' m_pollingServer = \'%s\'", + m_pollingTs ? m_pollingTs : "", + m_pollingKey ? m_pollingKey : "", + m_pollingServer ? m_pollingServer : ""); + if (m_pollingTs != NULL && m_pollingKey != NULL && m_pollingServer != NULL){ + debugLogA("CVkProto::OnReceivePollingInfo PollingThread starting..."); + m_hPollingThread = ForkThreadEx(&CVkProto::PollingThread, NULL, NULL); + } + else{ + debugLogA("CVkProto::OnReceivePollingInfo PollingThread not start"); + m_pollingConn = NULL; + ShutdownSession(); + return; + } + } + else + debugLogA("CVkProto::OnReceivePollingInfo m_hPollingThread is not NULL"); } void CVkProto::PollUpdates(JSONNODE *pUpdates) -- cgit v1.2.3