From 29b60266af600683a7b86b58f7f9929bfd3b7372 Mon Sep 17 00:00:00 2001 From: Sergey Bolhovskoy Date: Mon, 22 Dec 2014 18:04:29 +0000 Subject: VKontakte: fix? rare crash on OnSendMessage git-svn-id: http://svn.miranda-ng.org/main/trunk@11588 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/VKontakte/src/vk_proto.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'protocols') 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); -- cgit v1.2.3