diff options
Diffstat (limited to 'protocols/VKontakte/src/vk_queue.cpp')
-rw-r--r-- | protocols/VKontakte/src/vk_queue.cpp | 45 |
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 ¶m)
{
- 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 ¶m)
{
- 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 ¶m)
{
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;
}
|