From f5988c0e4245176f9b3c4380265e70ac2344f62a Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 10 Sep 2014 12:11:44 +0000 Subject: more code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@10421 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/VKontakte/src/vk_proto.h | 4 ++-- protocols/VKontakte/src/vk_queue.cpp | 16 +++++++--------- 2 files changed, 9 insertions(+), 11 deletions(-) (limited to 'protocols') diff --git a/protocols/VKontakte/src/vk_proto.h b/protocols/VKontakte/src/vk_proto.h index d1ff3aa750..60350ce5ab 100644 --- a/protocols/VKontakte/src/vk_proto.h +++ b/protocols/VKontakte/src/vk_proto.h @@ -239,11 +239,11 @@ private: friend struct AsyncHttpRequest; LIST m_arRequestsQueue; - CRITICAL_SECTION m_csRequestsQueue; - CMStringA m_prevUrl; + mir_cs m_csRequestsQueue; HANDLE m_evRequestsQueue; HANDLE m_hWorkerThread; bool m_bTerminated, m_bServerDelivery; + CMStringA m_prevUrl; struct Cookie { diff --git a/protocols/VKontakte/src/vk_queue.cpp b/protocols/VKontakte/src/vk_queue.cpp index 82fece41cc..bb506bd0ce 100644 --- a/protocols/VKontakte/src/vk_queue.cpp +++ b/protocols/VKontakte/src/vk_queue.cpp @@ -19,7 +19,6 @@ along with this program. If not, see . void CVkProto::InitQueue() { - ::InitializeCriticalSection(&m_csRequestsQueue); m_evRequestsQueue = CreateEvent(NULL, FALSE, FALSE, NULL); } @@ -27,7 +26,6 @@ void CVkProto::UninitQueue() { m_arRequestsQueue.destroy(); CloseHandle(m_evRequestsQueue); - ::DeleteCriticalSection(&m_csRequestsQueue); } ///////////////////////////////////////////////////////////////////////////////////////// @@ -37,13 +35,13 @@ void CVkProto::ExecuteRequest(AsyncHttpRequest *pReq) CMStringA str; LBL_Restart: - if (pReq->requestType == REQUEST_GET) { - str.Format("%s?%s", pReq->m_szUrl, pReq->m_szParam); - pReq->szUrl = str.GetBuffer(); - } - else { - pReq->szUrl = pReq->m_szUrl.GetBuffer(); - if (!pReq->m_szParam.IsEmpty()) { + pReq->szUrl = pReq->m_szUrl.GetBuffer(); + if (!pReq->m_szParam.IsEmpty()) { + if (pReq->requestType == REQUEST_GET) { + str.Format("%s?%s", pReq->m_szUrl, pReq->m_szParam); + pReq->szUrl = str.GetBuffer(); + } + else { pReq->pData = mir_strdup(pReq->m_szParam.GetBuffer()); pReq->dataLength = pReq->m_szParam.GetLength(); } -- cgit v1.2.3