summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src/vk_proto.cpp
diff options
context:
space:
mode:
authorSergey Bolhovskoy <elzorfox@ya.ru>2014-12-22 18:04:29 +0000
committerSergey Bolhovskoy <elzorfox@ya.ru>2014-12-22 18:04:29 +0000
commit29b60266af600683a7b86b58f7f9929bfd3b7372 (patch)
tree43b1530de30c0309aa972e788751dce6a779ec71 /protocols/VKontakte/src/vk_proto.cpp
parent751f3a2811dd60f5017eacd5a9a109fbe30c0f0c (diff)
VKontakte: fix? rare crash on OnSendMessage
git-svn-id: http://svn.miranda-ng.org/main/trunk@11588 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/vk_proto.cpp')
-rw-r--r--protocols/VKontakte/src/vk_proto.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp
index 11a71fa2d8..8362f77d23 100644
--- a/protocols/VKontakte/src/vk_proto.cpp
+++ b/protocols/VKontakte/src/vk_proto.cpp
@@ -470,7 +470,9 @@ int CVkProto::SendMsg(MCONTACT hContact, int flags, const char *msg)
pReq << CHAR_PARAM("message", szMsg);
pReq->AddHeader("Content-Type", "application/x-www-form-urlencoded");
- pReq->pUserInfo = new CVkSendMsgParam(hContact, msgId);
+ do
+ pReq->pUserInfo = new CVkSendMsgParam(hContact, msgId);
+ while (pReq->pUserInfo == NULL && pReq->m_iRetry-- > 0);
Push(pReq);
if (!m_bServerDelivery)
@@ -497,7 +499,7 @@ void CVkProto::OnSendMessage(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq)
UINT mid = json_as_int(pResponse);
if (param->iMsgID != -1)
m_sendIds.insert((HANDLE)mid);
- if (mid>getDword(param->hContact, "lastmsgid", 0))
+ if (mid > getDword(param->hContact, "lastmsgid", 0))
setDword(param->hContact, "lastmsgid", mid);
if (m_iMarkMessageReadOn >= markOnReply)
MarkMessagesRead(param->hContact);