I just found a bug of CCHttpRequest on cocos2d-x v2.0.2.
The response data is not complete in CCHttpResponse. Is anyone also meet this problem?
I just found a bug of CCHttpRequest on cocos2d-x v2.0.2.
The response data is not complete in CCHttpResponse. Is anyone also meet this problem?
Edit: Had the same problem but grabbing the latest versions from Github fixed it.
v2.0.3 has already solved this issue, you can modify CCHttpRequest as following:
// Callback function used by libcurl for collect response data
size_t writeData(void ptr, size_t size, size_t nmemb, voidstream)
{
std::vector recvBuffer = stream;
size_t sizes = size nmemb;
// add data to the end of recvBuffer
// write data maybe called more than once in a single request
recvBuffer->insert(recvBuffer->end(), (char*)ptr, (char*)ptr+sizes);
return sizes;
}
Robert Topala wrote:
Edit: Had the same problem but grabbing the latest versions from Github fixed it.