From 466907280fbee86f4d49777083c0a2a2821f4d50 Mon Sep 17 00:00:00 2001 From: Sergey Bolhovskoy Date: Sun, 9 Nov 2014 09:33:45 +0000 Subject: VKontakte: fix reconnect protocol after PollServer death (2) git-svn-id: http://svn.miranda-ng.org/main/trunk@10936 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/VKontakte/src/vk_thread.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp index 5b899ca58c..c480b74cc8 100644 --- a/protocols/VKontakte/src/vk_thread.cpp +++ b/protocols/VKontakte/src/vk_thread.cpp @@ -961,7 +961,17 @@ int CVkProto::PollServer() if (!IsOnline()){ debugLogA("CVkProto::PollServer is dead (not online)"); m_pollingConn = NULL; - ShutdownSession(); + if (m_iPollConnRetry){ + m_iPollConnRetry--; + debugLogA("CVkProto::PollServer restarting %d", MAX_RETRIES - m_iPollConnRetry); + Sleep(1000); + PollServer(); + } + else { + debugLogA("CVkProto::PollServer => ShutdownSession"); + m_iPollConnRetry = MAX_RETRIES; + ShutdownSession(); + } return 0; } -- cgit v1.2.3