if ( (curl_err_code = curl_easy_perform(CurlEasyHandle) ) != 0 )
{
Log->print_curl_error(url,curl_err_code,CurlErrBuff);
+ CurlWritedataBuff.clear();
return -1;
}
if ( (curl_err_code = curl_easy_getinfo(CurlEasyHandle,CURLINFO_RESPONSE_CODE,&curl_info)) != 0 )
{
Log->print_curl_error(url,curl_err_code);
+ CurlWritedataBuff.clear();
return -1;
}
Log->print_curl_data(CurlWritedataBuff);
+ // Copy the received data received via curl from the curl data buffer member to the received data member. This is needed because curl appends data to the buffer rather than overrites it.
+ ReceivedCurlData = CurlWritedataBuff;
+ CurlWritedataBuff.clear();
+
// Operation performed without any problems so we can return the curl_info
return curl_info;
}
*/
string HTTPHelper::get_curl_data() const
{
- return CurlWritedataBuff;
+ return ReceivedCurlData;
}
int ProxyPort;
CURL* CurlEasyHandle;
std::string CurlWritedataBuff;
+ std::string ReceivedCurlData;
char CurlErrBuff[CURL_ERROR_SIZE];
void set_curl_url(const std::string& url);