summaryrefslogtreecommitdiff
path: root/plugins/SecureIM/src/crypt_misc.cpp
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2015-04-30 06:34:32 +0000
committerKirill Volinsky <mataes2007@gmail.com>2015-04-30 06:34:32 +0000
commitcf45ff050dad2570c3172e111d739a3ae11a9ec1 (patch)
tree9322aa6d5f2cd848074216f0f2321ef55f8287bd /plugins/SecureIM/src/crypt_misc.cpp
parent2ebe714aaa6004ba617f04d2d11b4e5a763c1074 (diff)
minus critical section
git-svn-id: http://svn.miranda-ng.org/main/trunk@13277 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SecureIM/src/crypt_misc.cpp')
-rw-r--r--plugins/SecureIM/src/crypt_misc.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/plugins/SecureIM/src/crypt_misc.cpp b/plugins/SecureIM/src/crypt_misc.cpp
index 4c51d678cf..b43c516716 100644
--- a/plugins/SecureIM/src/crypt_misc.cpp
+++ b/plugins/SecureIM/src/crypt_misc.cpp
@@ -18,7 +18,7 @@ static void sttWaitForExchange(LPVOID param)
// if keyexchange failed or timeout
if (ptr->waitForExchange == 1 || ptr->waitForExchange == 3) { // протухло - отправляем незашифрованно, если надо
if (ptr->msgQueue && msgbox1(0, sim104, MODULENAME, MB_YESNO | MB_ICONQUESTION) == IDYES) {
- EnterCriticalSection(&localQueueMutex);
+ mir_cslock lck(localQueueMutex);
ptr->sendQueue = true;
pWM ptrMessage = ptr->msgQueue;
while (ptrMessage) {
@@ -33,13 +33,12 @@ static void sttWaitForExchange(LPVOID param)
}
ptr->msgQueue = NULL;
ptr->sendQueue = false;
- LeaveCriticalSection(&localQueueMutex);
}
ptr->waitForExchange = 0;
ShowStatusIconNotify(ptr->hContact);
}
else if (ptr->waitForExchange == 2) { // дослать очередь через установленное соединение
- EnterCriticalSection(&localQueueMutex);
+ mir_cslock lck(localQueueMutex);
// we need to resend last send back message with new crypto Key
pWM ptrMessage = ptr->msgQueue;
while (ptrMessage) {
@@ -54,10 +53,9 @@ static void sttWaitForExchange(LPVOID param)
}
ptr->msgQueue = NULL;
ptr->waitForExchange = 0;
- LeaveCriticalSection(&localQueueMutex);
}
else if (ptr->waitForExchange == 0) { // очистить очередь
- EnterCriticalSection(&localQueueMutex);
+ mir_cslock lck(localQueueMutex);
// we need to resend last send back message with new crypto Key
pWM ptrMessage = ptr->msgQueue;
while (ptrMessage) {
@@ -67,7 +65,6 @@ static void sttWaitForExchange(LPVOID param)
mir_free(tmp);
}
ptr->msgQueue = NULL;
- LeaveCriticalSection(&localQueueMutex);
}
}