Merge branch 'curl_raii' of https://github.com/sergey-shambir/cocos2d-x into sergey-shambir-curl_raii
Conflicts:
extensions/network/HttpClient.cpp
samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp
According to the cURL documentation the pointer that should be passed
to curl_easy_getinfo with CURLINFO_RESPONSE_CODE must be a long
pointer,
On platforms where long is 64Bit this will cause a stack corruption
destroying the pointer to the original resonse as the current response
code variable was a 32 Bit int value.
See: http://curl.haxx.se/libcurl/c/curl_easy_getinfo.html
Previously curl_slist_free_all(cHeaders) called in loop after
many break statements, so there was no garantue that it will be called
in all cases.
This change also simplifies code to make implementing PUT/DELETE methods
easier.
Some CCLog message contained trailing newlines which
made the logs hard to read on many platforms. The solution
here is to stip trailing newlines on those platforms, and also
to remove the newlines from the existing log messages.
cocos2d-x.git/extensions/network/HttpClient.h:64: warning: The following parameters of cocos2d::extension::CCHttpClient::setTimeoutForConnect(int value) are not documented:
parameter 'value'
cocos2d-x.git/extensions/network/HttpClient.h:79: warning: argument 'timeout' of command @param is not found in the argument list of CCHttpClient::setTimeoutForRead(int value)
cocos2d-x.git/extensions/network/HttpClient.h:79: warning: The following parameters of cocos2d::extension::CCHttpClient::setTimeoutForRead(int value) are not documented:
parameter 'value'