summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src/vk_queue.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-10-07 16:29:17 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-10-07 16:29:17 +0000
commit59de222d916876cc158d03909b661dd8b2cf6a3f (patch)
tree0eeffe666cfd2a5e151edacf26237cddab74d264 /protocols/VKontakte/src/vk_queue.cpp
parentae6d0b3c9f732c3770fc4bf00ba2e52012671108 (diff)
- frient list & statuses;
- code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@6396 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/vk_queue.cpp')
-rw-r--r--protocols/VKontakte/src/vk_queue.cpp29
1 files changed, 12 insertions, 17 deletions
diff --git a/protocols/VKontakte/src/vk_queue.cpp b/protocols/VKontakte/src/vk_queue.cpp
index be8c8868eb..47a146ffa9 100644
--- a/protocols/VKontakte/src/vk_queue.cpp
+++ b/protocols/VKontakte/src/vk_queue.cpp
@@ -60,7 +60,7 @@ void CVkProto::ExecuteRequest(AsyncHttpRequest *pReq)
/////////////////////////////////////////////////////////////////////////////////////////
-bool CVkProto::PushAsyncHttpRequest(int iRequestType, LPCSTR szUrl, bool bSecure, VK_REQUEST_HANDLER pFunc, int nParams, NETLIBHTTPHEADER *pParams, int iTimeout)
+bool CVkProto::PushAsyncHttpRequest(int iRequestType, LPCSTR szUrl, bool bSecure, VK_REQUEST_HANDLER pFunc, int nParams, HttpParam *pParams, int iTimeout)
{
if ( !SetupConnection())
return false;
@@ -124,27 +124,22 @@ void CVkProto::WorkerThread(void*)
}
while(true) {
- DWORD dwRet = WaitForSingleObject(m_evRequestsQueue, 1000);
- if (dwRet == WAIT_TIMEOUT) {
- // check expiration;
- continue;
- }
-
- if (dwRet != WAIT_OBJECT_0)
- continue;
-
+ WaitForSingleObject(m_evRequestsQueue, 1000);
if (m_bTerminated)
break;
AsyncHttpRequest *pReq;
- { mir_cslock lck(m_csRequestsQueue);
- if (m_arRequestsQueue.getCount() == 0)
- continue;
-
- pReq = m_arRequestsQueue[0];
- m_arRequestsQueue.remove(0);
+ while(true) {
+ {
+ mir_cslock lck(m_csRequestsQueue);
+ if (m_arRequestsQueue.getCount() == 0)
+ break;
+
+ pReq = m_arRequestsQueue[0];
+ m_arRequestsQueue.remove(0);
+ }
+ ExecuteRequest(pReq);
}
- ExecuteRequest(pReq);
}
OnLoggedOut();