summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorSergey Bolhovskoy <elzorfox@ya.ru>2014-11-09 09:33:45 +0000
committerSergey Bolhovskoy <elzorfox@ya.ru>2014-11-09 09:33:45 +0000
commit466907280fbee86f4d49777083c0a2a2821f4d50 (patch)
treed47c8d1dcc6a21fe20e9ce512de4afbe74ddef94 /protocols
parent61e32f0ca35a86873c18fd619945b7255e5900da (diff)
VKontakte: fix reconnect protocol after PollServer death (2)
git-svn-id: http://svn.miranda-ng.org/main/trunk@10936 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r--protocols/VKontakte/src/vk_thread.cpp12
1 files changed, 11 insertions, 1 deletions
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;
}