diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2015-08-18 11:14:19 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2015-08-18 11:14:19 +0000 |
commit | ce2529939b498acc2be8c3c09c897c6f96eee9f7 (patch) | |
tree | bc1466ac0eae8ad48758fb060349db9610b342c2 /protocols/SkypeWeb | |
parent | e934e6f00db72324d80ff0c272249435d884cc64 (diff) |
SkypeWeb: more fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@14982 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb')
-rw-r--r-- | protocols/SkypeWeb/src/skype_messages.cpp | 4 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_polling.cpp | 15 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_trouter.h | 14 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/stdafx.h | 15 |
4 files changed, 29 insertions, 19 deletions
diff --git a/protocols/SkypeWeb/src/skype_messages.cpp b/protocols/SkypeWeb/src/skype_messages.cpp index e29534bbb1..1585ace33a 100644 --- a/protocols/SkypeWeb/src/skype_messages.cpp +++ b/protocols/SkypeWeb/src/skype_messages.cpp @@ -89,7 +89,7 @@ void CSkypeProto::OnMessageSent(const NETLIBHTTPREQUEST *response, void *arg) auto it = m_mpOutMessages.find(hMessage);
if (it == m_mpOutMessages.end())
{
- m_mpOutMessages[hMessage] = (jRoot["OriginalArrivalTime"].as_int() / 1000);
+ m_mpOutMessages[hMessage] = std::stoull(jRoot["OriginalArrivalTime"].as_string()) / 1000;
}
}
ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, hMessage, 0);
@@ -187,7 +187,7 @@ void CSkypeProto::OnPrivateMessageEvent(const JSONNode &node) {
if (IsMe(szFromSkypename))
{
- HANDLE hMessage = (HANDLE)atol(szMessageId);
+ HANDLE hMessage = (HANDLE)std::stoull(szMessageId.GetString());
if (m_OutMessages.getIndex(hMessage) != -1)
{
auto it = m_mpOutMessages.find(hMessage);
diff --git a/protocols/SkypeWeb/src/skype_polling.cpp b/protocols/SkypeWeb/src/skype_polling.cpp index f5db4e8140..00e5555ef8 100644 --- a/protocols/SkypeWeb/src/skype_polling.cpp +++ b/protocols/SkypeWeb/src/skype_polling.cpp @@ -41,8 +41,16 @@ void CSkypeProto::PollingThread(void*) if (response->pData)
{
void *pData = mir_alloc(response->dataLength);
- memcpy(pData, response->pData, response->dataLength);
- ForkThread(&CSkypeProto::ParsePollData, pData);
+ if (pData != NULL)
+ {
+ memcpy(pData, response->pData, response->dataLength);
+ ForkThread(&CSkypeProto::ParsePollData, pData);
+ }
+ else
+ {
+ debugLogA(__FUNCTION__ ": memory overflow !!!");
+ break;
+ }
}
}
else
@@ -82,7 +90,7 @@ void CSkypeProto::ParsePollData(void *pData) {
debugLogA(__FUNCTION__);
- JSONNode data = JSONNode::parse(ptrA((char*)pData));
+ JSONNode data = JSONNode::parse((char*)pData);
if (!data) return;
const JSONNode &node = data["eventMessages"];
@@ -116,6 +124,7 @@ void CSkypeProto::ParsePollData(void *pData) ProcessThreadUpdate(resource);
}
}
+ mir_free(pData);
}
void CSkypeProto::ProcessEndpointPresence(const JSONNode &node)
diff --git a/protocols/SkypeWeb/src/skype_trouter.h b/protocols/SkypeWeb/src/skype_trouter.h index 8be933e445..4c792eaa47 100644 --- a/protocols/SkypeWeb/src/skype_trouter.h +++ b/protocols/SkypeWeb/src/skype_trouter.h @@ -18,18 +18,4 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #ifndef _SKYPE_TROUTER_H_
#define _SKYPE_TROUTER_H_
-struct TRInfo
-{
- std::string socketIo,
- connId,
- st,
- se,
- instance,
- ccid,
- sessId,
- sig,
- url;
- time_t lastRegistrationTime;
-};
-
#endif //_SKYPE_TROUTER_H_
\ No newline at end of file diff --git a/protocols/SkypeWeb/src/stdafx.h b/protocols/SkypeWeb/src/stdafx.h index 28665e61da..5f391969cc 100644 --- a/protocols/SkypeWeb/src/stdafx.h +++ b/protocols/SkypeWeb/src/stdafx.h @@ -78,6 +78,21 @@ struct LoginInfo ptrA szSkypename;
};
+
+struct TRInfo
+{
+ std::string socketIo,
+ connId,
+ st,
+ se,
+ instance,
+ ccid,
+ sessId,
+ sig,
+ url;
+ time_t lastRegistrationTime;
+}trouter;
+
#include "version.h"
#include "resource.h"
#include "skype_icons.h"
|