diff options
author | Sergey Bolhovskoy <elzorfox@ya.ru> | 2014-11-29 15:33:06 +0000 |
---|---|---|
committer | Sergey Bolhovskoy <elzorfox@ya.ru> | 2014-11-29 15:33:06 +0000 |
commit | 47ef7460d44bd169ada52ae8b1a2c7fa6f27d0d4 (patch) | |
tree | b0a44385d3cd73b4627bafd4deb5f473c990b8d9 /protocols/VKontakte/src/vk_queue.cpp | |
parent | fe076d92eca402b27979bacf4062563e759e7279 (diff) |
VKontakte:
fix(?) 5 sec freeze on Miranda shutdown
git-svn-id: http://svn.miranda-ng.org/main/trunk@11152 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/vk_queue.cpp')
-rw-r--r-- | protocols/VKontakte/src/vk_queue.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/protocols/VKontakte/src/vk_queue.cpp b/protocols/VKontakte/src/vk_queue.cpp index 5fbbff50df..0740c14ce6 100644 --- a/protocols/VKontakte/src/vk_queue.cpp +++ b/protocols/VKontakte/src/vk_queue.cpp @@ -58,7 +58,7 @@ void CVkProto::ExecuteRequest(AsyncHttpRequest *pReq) else if (pReq->bIsMainConn) {
if (m_iStatus >= ID_STATUS_CONNECTING && m_iStatus < ID_STATUS_CONNECTING + MAX_CONNECT_RETRIES)
ConnectionFailed(LOGINERR_NONETWORK);
- else if (pReq->m_iRetry){
+ else if (pReq->m_iRetry && !m_bTerminated){
pReq->bNeedsRestart = true;
Sleep(1000); //Pause for fix err
pReq->m_iRetry--;
@@ -70,7 +70,7 @@ void CVkProto::ExecuteRequest(AsyncHttpRequest *pReq) }
}
debugLogA("CVkProto::ExecuteRequest pReq->bNeedsRestart = %d", (int)pReq->bNeedsRestart);
- } while (pReq->bNeedsRestart);
+ } while (pReq->bNeedsRestart && !m_bTerminated);
delete pReq;
}
@@ -127,6 +127,8 @@ void CVkProto::WorkerThread(void*) m_arRequestsQueue.remove(0);
need_sleep = (m_arRequestsQueue.getCount() > 1) && (pReq->m_bApiReq); // more than two to not gather
}
+ if (m_bTerminated)
+ break;
ExecuteRequest(pReq);
if (need_sleep) // There can be maximum 3 requests to API methods per second from a client
Sleep(330); // (c) https://vk.com/dev/api_requests
|