summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src/vk_queue.cpp
diff options
context:
space:
mode:
authorSergey Bolhovskoy <elzorfox@ya.ru>2014-09-09 10:45:10 +0000
committerSergey Bolhovskoy <elzorfox@ya.ru>2014-09-09 10:45:10 +0000
commit24a161c41edfebcc4850bd58480649ff2ddf8d7f (patch)
tree6793c7a8dc85b8c9bb8cc7c5ce8cc4683d6c1709 /protocols/VKontakte/src/vk_queue.cpp
parent199bf2fee8e9f3844744288a8dde5d2dbc5ff55f (diff)
VKontakte: fix for 'To many MarkAsRead', redesign PARAM structure
git-svn-id: http://svn.miranda-ng.org/main/trunk@10410 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/vk_queue.cpp')
-rw-r--r--protocols/VKontakte/src/vk_queue.cpp45
1 files changed, 36 insertions, 9 deletions
diff --git a/protocols/VKontakte/src/vk_queue.cpp b/protocols/VKontakte/src/vk_queue.cpp
index b19d47f4cc..5b9fc4b282 100644
--- a/protocols/VKontakte/src/vk_queue.cpp
+++ b/protocols/VKontakte/src/vk_queue.cpp
@@ -113,25 +113,52 @@ void CVkProto::WorkerThread(void*)
AsyncHttpRequest* operator<<(AsyncHttpRequest *pReq, const INT_PARAM &param)
{
- CMStringA &s = pReq->m_szUrl;
- s.AppendFormat("%c%s=%i", pReq->m_bHasParams ? '&' : '?', param.szName, param.iValue);
- pReq->m_bHasParams = true;
+ if (param.rtType == reqGET){
+ CMStringA &s = pReq->m_szUrl;
+ s.AppendFormat("%c%s=%i", pReq->m_bHasGParams ? '&' : '?', param.szName, param.iValue);
+ pReq->m_bHasGParams = true;
+ }
+ else {
+ CMStringA s = pReq->pData;
+ s.AppendFormat("%s%s=%i", pReq->m_bHasPParams ? "&" : "?", param.szName, param.iValue);
+ pReq->pData = mir_strdup(s);
+ pReq->dataLength = s.GetLength();
+ pReq->m_bHasPParams = true;
+ }
return pReq;
}
AsyncHttpRequest* operator<<(AsyncHttpRequest *pReq, const CHAR_PARAM &param)
{
- CMStringA &s = pReq->m_szUrl;
- s.AppendFormat("%c%s=%s", pReq->m_bHasParams ? '&' : '?', param.szName, ptrA(mir_urlEncode(param.szValue)));
- pReq->m_bHasParams = true;
+ if (param.rtType == reqGET){
+ CMStringA &s = pReq->m_szUrl;
+ s.AppendFormat("%c%s=%s", pReq->m_bHasGParams ? '&' : '?', param.szName, ptrA(mir_urlEncode(param.szValue)));
+ pReq->m_bHasGParams = true;
+ }
+ else {
+ CMStringA s = pReq->pData;
+ s.AppendFormat("%s%s=%s", pReq->m_bHasPParams ? "&" : "", param.szName, ptrA(mir_urlEncode(param.szValue)));
+ pReq->pData = mir_strdup(s);
+ pReq->dataLength = s.GetLength();
+ pReq->m_bHasPParams = true;
+ }
return pReq;
}
AsyncHttpRequest* operator<<(AsyncHttpRequest *pReq, const TCHAR_PARAM &param)
{
ptrA szValue(mir_utf8encodeT(param.tszValue));
- CMStringA &s = pReq->m_szUrl;
- s.AppendFormat("%c%s=%s", pReq->m_bHasParams ? '&' : '?', param.szName, ptrA(mir_urlEncode(szValue)));
- pReq->m_bHasParams = true;
+ if (param.rtType == reqGET){
+ CMStringA &s = pReq->m_szUrl;
+ s.AppendFormat("%c%s=%s", pReq->m_bHasGParams ? '&' : '?', param.szName, ptrA(mir_urlEncode(szValue)));
+ pReq->m_bHasGParams = true;
+ }
+ else{
+ CMStringA s = pReq->pData;
+ s.AppendFormat("%s%s=%s", pReq->m_bHasGParams ? "&" : "?", param.szName, ptrA(mir_urlEncode(szValue)));
+ pReq->pData = mir_strdup(s);
+ pReq->dataLength = s.GetLength();
+ pReq->m_bHasPParams = true;
+ }
return pReq;
}