summaryrefslogtreecommitdiff
path: root/protocols/AimOscar/src/packets.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-07-13 10:50:59 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-07-13 10:50:59 +0000
commit5df94ff719eccd04c7450df35fb5e3f2b36e2ee7 (patch)
tree440d736b199ff849ca0619adf355ffc73750ca7f /protocols/AimOscar/src/packets.cpp
parent70496fb739225b559a251f4518c946110aef718c (diff)
wrapping the most evident critical sections into a class
git-svn-id: http://svn.miranda-ng.org/main/trunk@9785 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/AimOscar/src/packets.cpp')
-rw-r--r--protocols/AimOscar/src/packets.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/protocols/AimOscar/src/packets.cpp b/protocols/AimOscar/src/packets.cpp
index 3a4a5fc7f6..f4f44ab8bf 100644
--- a/protocols/AimOscar/src/packets.cpp
+++ b/protocols/AimOscar/src/packets.cpp
@@ -65,7 +65,7 @@ int aim_writetlvlong64(unsigned short type, unsigned __int64 value, unsigned sho
int CAimProto::aim_sendflap(HANDLE hServerConn, char type,unsigned short length,const char *buf, unsigned short &seqno)
{
- EnterCriticalSection(&SendingMutex);
+ mir_cslock lck(SendingMutex);
const int slen = FLAP_SIZE + length;
char* obuf = (char*)alloca(slen);
flap_header *flap = (flap_header*)obuf;
@@ -76,7 +76,6 @@ int CAimProto::aim_sendflap(HANDLE hServerConn, char type,unsigned short length,
memcpy(&obuf[FLAP_SIZE], buf, length);
int rlen= Netlib_Send(hServerConn, obuf, slen, 0);
if (rlen == SOCKET_ERROR) seqno--;
- LeaveCriticalSection(&SendingMutex);
return rlen >= 0 ? 0 : -1;
}