| |
|
|
|
cURL Mailing List Monthly Index Single Mail
curl-library Mailing List Archives
About write call function
From: Ajeet kumar.S <ajeetkumar.s_at_jasmin-infotech.com>
Date: Wed, 14 May 2008 11:25:57 +0530
Hi All;
For receiving the data coming from server I set below option and
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, ReadCallback);
int totalsize;
void ReadCallback( char *data_ptr, size_t size, size_t nmemb, char *data)
{
unsigned int data_size;
data_size = size * nmemb;
if ((totalsize+data_size) <= 102400)
{
memcpy(http_ptr,data_ptr,data_size);
http_ptr+=data_size;
totalsize += data_size;
printf("\n ReadCallback - totalsize = %d \n",totalsize);
fflush(stdout);
}
else
{
totalsize = 0;
http_ptr = &Http_Rx_Data[0];
memcpy(http_ptr,data_ptr,data_size);
http_ptr+=data_size;
totalsize += data_size;
printf("\n ReadCallback - totalsize = %d \n",totalsize);
fflush(stdout);
}
}
Actually my doubt is if we want to write the data to our defined buffer it
CURLE_WRITE_ERROR.
Another way I also tried http_ptr =data; this is failed. Actually if we do
then we will not able to write the data what we define buffer
Please suggest me how we can write data to our own defined buffer using
Thank you.
Regards;
Ajeet Kumar Singh
These mail archives are generated by hypermail. |
Page updated November 12, 2010.
web site info